getAttachments method
This commit is contained in:
@@ -35,6 +35,7 @@ use Espo\Core\ORM\Entity;
|
||||
use Espo\Core\Field\DateTime;
|
||||
use Espo\Core\Field\LinkParent;
|
||||
use Espo\Core\Field\Link;
|
||||
use Espo\ORM\Collection;
|
||||
use Espo\Repositories\Email as EmailRepository;
|
||||
use Espo\Tools\Email\Util as EmailUtil;
|
||||
|
||||
@@ -767,4 +768,13 @@ class Email extends Entity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<Attachment>
|
||||
*/
|
||||
public function getAttachments(): iterable
|
||||
{
|
||||
/** @var Collection<Attachment> */
|
||||
return $this->relations->getMany('attachments');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ use Espo\Core\ORM\Entity;
|
||||
|
||||
use Espo\Core\Field\DateTime;
|
||||
|
||||
use Espo\ORM\Collection;
|
||||
use RuntimeException;
|
||||
use stdClass;
|
||||
|
||||
@@ -355,4 +356,13 @@ class Note extends Entity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<Attachment>
|
||||
*/
|
||||
public function getAttachments(): iterable
|
||||
{
|
||||
/** @var Collection<Attachment> */
|
||||
return $this->relations->getMany('attachments');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace Espo\Modules\Crm\Entities;
|
||||
|
||||
use Espo\Core\Field\Link;
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Entities\Attachment;
|
||||
use Espo\ORM\Collection;
|
||||
|
||||
class CaseObj extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
@@ -107,4 +109,13 @@ class CaseObj extends \Espo\Core\ORM\Entity
|
||||
/** @var string[] */
|
||||
return $this->getLinkMultipleIdList('attachments');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<Attachment>
|
||||
*/
|
||||
public function getAttachments(): iterable
|
||||
{
|
||||
/** @var Collection<Attachment> */
|
||||
return $this->relations->getMany('attachments');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace Espo\Modules\Crm\Entities;
|
||||
use Espo\Core\Field\Link;
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Core\ORM\Entity;
|
||||
use Espo\Entities\Attachment;
|
||||
use Espo\ORM\Collection;
|
||||
|
||||
class KnowledgeBaseArticle extends Entity
|
||||
{
|
||||
@@ -70,4 +72,13 @@ class KnowledgeBaseArticle extends Entity
|
||||
/** @var string[] */
|
||||
return $this->getLinkMultipleIdList('attachments');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<Attachment>
|
||||
*/
|
||||
public function getAttachments(): iterable
|
||||
{
|
||||
/** @var Collection<Attachment> */
|
||||
return $this->relations->getMany('attachments');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ use Espo\Core\Field\Link;
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Core\Field\LinkParent;
|
||||
use Espo\Core\ORM\Entity;
|
||||
use Espo\Entities\Attachment;
|
||||
use Espo\ORM\Collection;
|
||||
|
||||
class Task extends Entity
|
||||
{
|
||||
@@ -105,4 +107,13 @@ class Task extends Entity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<Attachment>
|
||||
*/
|
||||
public function getAttachments(): iterable
|
||||
{
|
||||
/** @var Collection<Attachment> */
|
||||
return $this->relations->getMany('attachments');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user