/**
  * 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
 public static function createFor($entityClass, $collectionPropertyName, DCPackage $dc)
 {
     $entityMeta = $dc->getEntityMeta($entityClass);
     $property = $entityMeta->getPropertyMeta($collectionPropertyName);
     $collectionClass = $property->getRelationEntityClass();
     return new static($entityMeta, $collectionPropertyName, $dc->getRepository($collectionClass->getFQN()));
 }
예제 #3
0
 /**
  * Gibt die EntityMeta zu diesem (einem bestimmten) Entity zurück
  * 
  * @param string|NULL $entityClass wird die klasse nicht übergeben wird $this->getEntityName() genommen
  * @return Psc\CMS\EntityMetaData
  */
 public function getEntityMeta($entityClass = NULL)
 {
     return $this->dc->getEntityMeta($entityClass ?: $this->getEntityname());
 }