コード例 #1
0
 /**
  * Do the initialization logic
  *
  * @return void
  * @throws RpcExceptionInterface
  */
 protected function doInitialize()
 {
     $persister = $this->manager->getUnitOfWork()->getEntityPersister($this->metadata->getName());
     /** @var Collection $collection */
     $collection = call_user_func_array([$persister, 'loadAll'], $this->searchArgs);
     if ($collection instanceof AbstractLazyCollection && $this->owner) {
         $collection = $persister->loadOneToManyCollection($this->association, $this->owner, $collection);
     }
     $this->collection = $collection;
 }
コード例 #2
0
 /**
  * Initializes a new IdentifierFlattener instance, bound to the given EntityManager.
  *
  * @param ApiEntityManager $manager
  *
  * @internal param UnitOfWork $unitOfWork
  * @internal param ClassMetadataFactory $metadataFactory
  */
 public function __construct(ApiEntityManager $manager)
 {
     $this->manager = $manager;
     $this->unitOfWork = $this->manager->getUnitOfWork();
 }