diff --git a/src/EntityManager.php b/src/EntityManager.php index 5a29169e..7448ec10 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -87,6 +87,16 @@ class EntityManager implements EntityManagerInterface */ protected $entityPersisters = []; + /** + * EntityManager constructor. + * + * @param ClientInterface $databaseDriver + * @param null|string $cacheDirectory + * @param null|EventManager $eventManager + * @param null|GraphEntityMetadataFactoryInterface $metadataFactory + * + * @throws \Doctrine\Common\Annotations\AnnotationException + */ public function __construct( ClientInterface $databaseDriver, $cacheDirectory = null, @@ -106,11 +116,7 @@ public function __construct( } /** - * @param string $host - * @param string|null $cacheDir - * @param EventManager|null $eventManager - * - * @return EntityManager + * {@inheritdoc} */ public static function create($host, $cacheDir = null, EventManager $eventManager = null) { @@ -194,11 +200,17 @@ public function getMetadataFactory() return $this->metadataFactory; } + /** + * {@inheritdoc} + */ public function initializeObject($obj) { $this->uow->initializeObject($obj); } + /** + * {@inheritdoc} + */ public function contains($entity) { return $this->uow->isScheduledForCreate($entity) @@ -361,14 +373,16 @@ public function getEntityHydrator($className) return $this->entityHydrators[$className]; } + /** + * {@inheritdoc} + */ public function getEntityPersister($className) { return new BasicEntityPersister($className, $this->getClassMetadataFor($className), $this); } /** - * @param string $cql - * @return Query + * {@inheritdoc} */ public function createQuery($cql = '') { @@ -381,6 +395,9 @@ public function createQuery($cql = '') return $query; } + /** + * {@inheritdoc} + */ public function registerPropertyConverter($name, $classname) { Converter::addConverter($name, $classname); diff --git a/src/EntityManagerInterface.php b/src/EntityManagerInterface.php index 158c77b4..6998bb5a 100644 --- a/src/EntityManagerInterface.php +++ b/src/EntityManagerInterface.php @@ -13,9 +13,22 @@ use Doctrine\Common\EventManager; use Doctrine\Common\Persistence\ObjectManager; +use GraphAware\Neo4j\OGM\Hydrator\EntityHydrator; +use GraphAware\Neo4j\OGM\Metadata\NodeEntityMetadata; +use GraphAware\Neo4j\OGM\Persisters\BasicEntityPersister; +use GraphAware\Neo4j\OGM\Proxy\ProxyFactory; interface EntityManagerInterface extends ObjectManager { + /** + * @param string $host + * @param null|string $cacheDir + * @param null|EventManager $eventManager + * + * @return EntityManagerInterface + */ + public static function create($host, $cacheDir = null, EventManager $eventManager = null); + /** * @return EventManager */ @@ -60,4 +73,47 @@ public function getRelationshipEntityMetadata($class); * @return \GraphAware\Neo4j\OGM\Repository\BaseRepository */ public function getRepository($class); + + /** + * @return string + */ + public function getProxyDirectory(); + + /** + * @param NodeEntityMetadata $entityMetadata + * + * @return ProxyFactory + */ + public function getProxyFactory(NodeEntityMetadata $entityMetadata); + + /** + * @param string $className + * + * @return EntityHydrator + */ + public function getEntityHydrator($className); + + /** + * @param string $className + * + * @return BasicEntityPersister + */ + public function getEntityPersister($className); + + /** + * @param string $cql + * + * @return Query + */ + public function createQuery($cql = ''); + + /** + * @param string $name + * @param string $classname + * + * @return void + */ + public function registerPropertyConverter($name, $classname); + + public function getAnnotationDriver(); }