/**
  * Update
  *
  * @param array $data
  * @return bool|\Doctrine\Common\Proxy\Proxy|null|object|void
  * @throws \Doctrine\ORM\ORMException
  * @throws \Exception
  */
 public function update(array $data)
 {
     $entity = $this->em->getReference($this->entity, $data['id']);
     $entity = Configurator::configure($entity, $data);
     $this->em->persist($entity);
     $this->em->flush();
     return $entity;
 }
Пример #2
0
 public function update(array $data)
 {
     $entity = $this->em->getReference($this->entity, $data['id']);
     $entity = Configurator::configure($entity, $data);
     $category = $this->em->getReference('Bookstore\\Entity\\Category', $data['categories']);
     $entity->setCategory($category);
     $this->em->persist($entity);
     $this->em->flush();
     return $entity;
 }
Пример #3
0
 /**
  * Construct
  *
  * @param null $options
  * @throws \Exception
  */
 public function __construct($options = null)
 {
     Configurator::configure($this, $options);
     $this->books = new ArrayCollection();
 }