/**
  * Erstellt einen Synchronizer für das $collectionPropertyName in $entityClass
  *
  * @return PersistentCollectionSynchronizer
  */
 public static function createFor($entityClass, $collectionPropertyName, DCPackage $dc)
 {
     $entityMeta = $dc->getEntityMeta($entityClass);
     $property = $entityMeta->getPropertyMeta($collectionPropertyName);
     $collectionClass = $property->getRelationEntityClass();
     $synchronizer = new static($entityMeta, $property->getName(), new UniqueEntityHydrator($dc->getEntityManager()->getRepository($collectionClass->getFQN())), new EntityFactory($dc->getEntityMeta($collectionClass->getFQN())));
     return $synchronizer;
 }
예제 #2
0
 protected function createEntityProcessor(Entity $entity)
 {
     return new \Psc\Doctrine\Processor($entity, $this->dc->getEntityManager(), $this->dc);
 }
예제 #3
0
 protected function createImageManager()
 {
     return ImageManager::createForProject($this->project, $this->dc->getEntityManager(), $this->getRoleFQN('Image'));
 }
예제 #4
0
 public function clear()
 {
     $this->dc->getEntityManager()->clear();
 }
예제 #5
0
 public function __construct($entityName, DCPackage $dc)
 {
     $this->em = $dc->getEntityManager();
     $this->entityName = $dc->getModule()->getEntityName($entityName);
 }