deprecate createCollection
This commit is contained in:
@@ -33,6 +33,9 @@ use Espo\Core\Exceptions\NotFound;
|
||||
|
||||
class Document extends \Espo\Services\Record
|
||||
{
|
||||
/**
|
||||
* @return iterable
|
||||
*/
|
||||
public function getAttachmentList(string $id)
|
||||
{
|
||||
$entity = $this->getEntity($id);
|
||||
@@ -51,9 +54,14 @@ class Document extends \Espo\Services\Record
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$attachment = $this->getEntityManager()->getRepository('Attachment')->getCopiedAttachment($file, 'Attachment');
|
||||
$attachment = $this->entityManager
|
||||
->getRepository('Attachment')
|
||||
->getCopiedAttachment($file, 'Attachment');
|
||||
|
||||
$attachmentList = $this->entityManager
|
||||
->getCollectionFactory()
|
||||
->create('Attachment');
|
||||
|
||||
$attachmentList = $this->getEntityManager()->createCollection('Attachment');
|
||||
$attachmentList[] = $attachment;
|
||||
|
||||
return $attachmentList;
|
||||
|
||||
@@ -308,7 +308,9 @@ class TargetList extends \Espo\Services\Record implements
|
||||
|
||||
$sth = $em->getQueryExecutor()->execute($unionQuery);
|
||||
|
||||
$collection = $this->getEntityManager()->createCollection();
|
||||
$collection = $this->entityManager
|
||||
->getCollectionFactory()
|
||||
->create();
|
||||
|
||||
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
|
||||
$itemEntity = $this->getEntityManager()->getEntity($row['entityType']);
|
||||
|
||||
@@ -476,7 +476,7 @@ class EntityManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a collection. An entity type can be omitted.
|
||||
* @deprecated Use `getCollectionFactory`.
|
||||
*/
|
||||
public function createCollection(?string $entityType = null, array $data = []): EntityCollection
|
||||
{
|
||||
|
||||
@@ -79,7 +79,9 @@ class Notification extends \Espo\Services\Record implements
|
||||
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
$collection = $this->entityManager->createCollection();
|
||||
$collection = $this->entityManager
|
||||
->getCollectionFactory()
|
||||
->create();
|
||||
|
||||
$userList = $this->entityManager
|
||||
->getRepository('User')
|
||||
@@ -87,7 +89,8 @@ class Notification extends \Espo\Services\Record implements
|
||||
->where([
|
||||
'isActive' => true,
|
||||
'id' => $userIdList,
|
||||
])->find();
|
||||
])
|
||||
->find();
|
||||
|
||||
foreach ($userList as $user) {
|
||||
$userId = $user->id;
|
||||
|
||||
Reference in New Issue
Block a user