Пример #1
0
 /**
  * @param string $className
  * @param array  $data
  *
  * @return object
  */
 private function createObject($className, array $data)
 {
     $repository = $this->objectManager->getRepository($className);
     $object = $repository->create($className);
     if ($object instanceof NotifyPropertyChanged) {
         $object->addPropertyChangedListener($this);
     }
     $this->eventDispatcher->dispatchPreLoad($object, $data);
     $repository->hydrate($object, $data);
     $this->eventDispatcher->dispatchPostLoad($object);
     $this->objectIdentityMap->addToIdentityMap($object, $data);
     return $object;
 }
 /**
  * @param object $object
  *
  * @return array $identifier
  */
 protected function getObjectIdentifier($object)
 {
     return $this->objectManager->getRepository(get_class($object))->getObjectIdentifier($object);
 }
 /**
  * @param object $object
  *
  * @return array
  */
 protected function getObjectIdentifier($object)
 {
     return $this->objectManager->getRepository($this->getClassName())->getObjectIdentifier($object);
 }