示例#1
0
 public function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
 {
     if (!$where) {
         $where = array('user_id' => $entity->getId());
     }
     return parent::update($entity, $where, $tableName, $hydrator);
 }
示例#2
0
 public function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
 {
     if (!$where) {
         $where = 'id = ' . $entity->getId();
     }
     return parent::update($entity, $where, $tableName, $hydrator);
 }
示例#3
0
 protected function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
 {
     if (!$where) {
         $where = 'method_id = ' . $entity->getMethodId();
     }
     return parent::update($entity, $where, $tableName, $hydrator);
 }
 public function removeSerie($userId, $serieId)
 {
     $where = new Where();
     $where->equalTo('user_id', $userId);
     $where->equalTo('sid', $serieId);
     return parent::delete($where, $this->tableName);
 }
 /**
  * {@inheritDoc}
  */
 public function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
 {
     $this->checkEntity($entity, __METHOD__);
     if (!$where) {
         $where = array('user_id' => $entity->getUser()->getId());
     }
     return parent::update($entity, $where);
 }
示例#6
0
 protected function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
 {
     if (!$where) {
         $where = 'computer_id = ' . $entity->getComputerId();
     }
     $entity->setModified(new \DateTime());
     return parent::update($entity, $where, $tableName, $hydrator);
 }
示例#7
0
 protected function update($entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
 {
     $entity->setModifiedDate(new DateTime());
     if (!$where) {
         $where = 'project_id = ' . $entity->getProjectId();
     }
     return parent::update($entity, $where, $tableName, $hydrator);
 }
示例#8
0
文件: User.php 项目: galaco/chatter
 public function updatePassword($userId, $password)
 {
     $where = [];
     $where[] = 'user_id = ' . $userId;
     $entity = ['password' => $password];
     $success = parent::update($entity, $where, $this->tableName, null);
     return $success;
 }
示例#9
0
 public function updateEntity($id, $data)
 {
     if (is_object($data)) {
         $data = (array) $data;
     }
     if (!empty($data)) {
         $result = parent::update($data, array('id' => $id));
     }
     return $this->fetch($id);
 }
示例#10
0
 public function storeVisitIfUnique($visit)
 {
     $select = $this->getSelect()->where(array('ip_address' => $visit->getIpAddress(), 'thread_id' => $visit->getThread()->getThreadId()));
     $result = $this->select($select)->current();
     if (!$result) {
         parent::insert($visit, null, new VisitHydrator());
         return true;
     } else {
         return false;
     }
 }
示例#11
0
文件: Post.php 项目: galaco/chatter
 public function updatePost($postId, $content)
 {
     $entity = ['content' => $content, 'last_updated' => date('Y/m/d H:i:s')];
     $predicate = new Predicate(null, Predicate::OP_AND);
     $predicate->equalTo('id', $postId);
     try {
         $result = parent::update($entity, $predicate, $this->tableName, null);
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
示例#12
0
 public function deleteUuid($uuid)
 {
     $where = ['uuid' => $uuid];
     $result = parent::delete($where, $this->tableName);
     return $result;
 }
 public function delete($entity, $where = null, $tableName = null)
 {
     if (!$where) {
         $where = 'module_id = ' . $entity->getId();
     }
     return parent::delete($where, $tableName);
 }
示例#14
0
 public function persistProjectPpe($projectPpe)
 {
     return parent::insert($projectPpe, null, new projectPpeHydrator());
 }
示例#15
0
 public function persistProjectSubstance($projectSubstance)
 {
     return parent::insert($projectSubstance, null, new projectSubstanceHydrator());
 }
示例#16
0
 public function insert($data, $tableName = NULL, \Zend\Stdlib\Hydrator\HydratorInterface $hydrator = NULL)
 {
     return parent::insert($data, $tableName);
 }
 public function insert($registrationEntity)
 {
     return parent::insert($registrationEntity)->getAffectedRows();
 }
示例#18
0
 /**
  * (non-PHPdoc)
  *
  * @see \ZfcBase\Mapper\AbstractDbMapper::getSelect()
  */
 public function getSelect($table = null)
 {
     return parent::getSelect($table);
 }
示例#19
0
 /**
  * Proxy to parent protected method
  *
  * @param  object|array                $entity
  * @param  string|TableIdentifier|null $tableName
  * @param  HydratorInterface|null      $hydrator
  * @return ResultInterface
  */
 public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     return parent::insert($entity, $tableName, $hydrator);
 }
示例#20
0
 public function deleteUserProvider($ids)
 {
     return parent::delete(array('(user_id IN (' . $ids . '))'));
 }
示例#21
0
 /**
  * @todo
  */
 public function persist($passwordModel)
 {
     return parent::insert($passwordModel);
 }
示例#22
0
文件: Thread.php 项目: galaco/chatter
 public function deleteThread($id)
 {
     $entity = ['deleted' => "1"];
     $where = ['id = ' . $id];
     parent::update($entity, $where, $this->tableName, null);
 }
示例#23
0
 public function update(ContactEntity $contact)
 {
     return parent::update($contact, array('id' => $contact->getId()));
 }
 public function delete($userId, $postId)
 {
     return parent::delete(array('userId' => $userId, 'postId' => $postId))->getAffectedRows();
 }
示例#25
0
 protected function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $result = parent::insert($entity, $tableName, $hydrator);
     //     $entity->setLogicalDiskId($result->getGeneratedValue());
     return $result;
 }