コード例 #1
0
ファイル: Account.php プロジェクト: bolt/Members
 /**
  * {@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();
 }
コード例 #2
0
ファイル: Repository.php プロジェクト: bolt/bolt
 /**
  * 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();
 }