Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function update($entity, $exclusions = [])
 {
     $querySet = new QuerySet();
     $querySet->setParentId($entity->getGuid());
     $qb = $this->em->createQueryBuilder();
     $qb->update($this->getTableName())->where('guid = :guid')->setParameter('guid', $entity->getGuid());
     $querySet->append($qb);
     /** @var \Bolt\Storage\Entity\Entity $entity */
     $this->persist($querySet, $entity, ['id'] + $exclusions);
     return $querySet->execute();
 }
Esempio n. 2
0
 /**
  * Updates an object into the database.
  *
  * @param object   $entity     The entity to update.
  * @param string[] $exclusions Ignore updates to these fields
  *
  * @return bool
  */
 public function update($entity, $exclusions = [])
 {
     $querySet = new QuerySet();
     $querySet->setParentId($entity->getId());
     $qb = $this->em->createQueryBuilder();
     $qb->update($this->getTableName())->where('id = :id')->setParameter('id', $entity->getId());
     $querySet->append($qb);
     $this->persist($querySet, $entity, $exclusions);
     return $querySet->execute();
 }