예제 #1
0
파일: User.php 프로젝트: antarus/mystra-pve
 public function insert($entity, $tableName = null, Hydrator $hydrator = null)
 {
     $hydrator = $hydrator ?: $this->getHydrator();
     $result = parent::insert($entity, $tableName, $hydrator);
     $entity->setId($result->getGeneratedValue());
     return $result;
 }
예제 #2
0
파일: User.php 프로젝트: rawatanil3/ZfcUser
 public function insert($entity, $tableName = null, Hydrator $hydrator = null)
 {
     $hydrator = $hydrator ?: $this->getHydrator();
     $result = parent::insert($entity, $tableName, $hydrator);
     $hydrator->hydrate(array('user_id' => $result->getGeneratedValue()), $entity);
     return $result;
 }
예제 #3
0
 public function insert(ContactEntity $contact)
 {
     if ($contact->getId() != null) {
         return $this->update($contact);
     }
     return parent::insert($contact);
 }
예제 #4
0
파일: UserUuid.php 프로젝트: galaco/chatter
 public function genUuid($userId, $type)
 {
     $uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
     $entity = ['user_id' => $userId, 'uuid' => $uuid, 'type' => $type];
     parent::insert($entity, $this->tableName, null);
     return $uuid;
 }
예제 #5
0
 protected function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     die(var_dump($entity));
     $result = parent::insert($entity, $tableName, $hydrator);
     $entity->setComputerId($result->getGeneratedValue());
     return $result;
 }
예제 #6
0
 protected function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $entity->setCreatedDate(new DateTime())->setCreatedById(-1);
     $result = parent::insert($entity, $tableName, $hydrator);
     $entity->setProjectId($result->getGeneratedValue());
     return $result;
 }
예제 #7
0
 public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $options = $this->getOptions();
     $tableName = $options['user_role_linker'];
     $entity['role_id'] = $options['user_role_id'];
     $result = parent::insert($entity, $tableName, $hydrator);
     return $result;
 }
예제 #8
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;
     }
 }
예제 #9
0
파일: Thread.php 프로젝트: galaco/chatter
 public function saveThread($forumId, $userId, $title, $sticky)
 {
     $entity = ['forum_id' => $forumId, 'user_id' => $userId, 'title' => $title, 'date_added' => date('Y/m/d H:i:s')];
     if ($sticky) {
         $entity['sticky'] = true;
     }
     try {
         $result = parent::insert($entity, $this->tableName, null);
     } catch (Exception $e) {
         return false;
     }
     return $result;
 }
예제 #10
0
파일: Post.php 프로젝트: galaco/chatter
 public function savePost($threadId, $userId, $message)
 {
     $date = date('Y/m/d H:i:s');
     $entity = ['thread_id' => $threadId, 'user_id' => $userId, 'content' => $message, 'date_added' => $date];
     try {
         $result = parent::insert($entity, $this->tableName, null);
     } catch (Exception $e) {
         return false;
     }
     $e2 = ['date_updated' => $date];
     $predicate = new Predicate(null, Predicate::OP_AND);
     $predicate->equalTo('id', $threadId);
     try {
         $result = parent::update($e2, $predicate, 'thread', null);
     } catch (Exception $e) {
         return false;
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $this->checkEntity($entity, __METHOD__);
     return parent::insert($entity);
 }
예제 #12
0
 /**
  * @todo
  */
 public function persist($passwordModel)
 {
     return parent::insert($passwordModel);
 }
 public function insert($registrationEntity)
 {
     return parent::insert($registrationEntity)->getAffectedRows();
 }
예제 #14
0
 public function insert($data, $tableName = NULL, \Zend\Stdlib\Hydrator\HydratorInterface $hydrator = NULL)
 {
     return parent::insert($data, $tableName);
 }
예제 #15
0
 protected function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $result = parent::insert($entity, $tableName, $hydrator);
     //     $entity->setLogicalDiskId($result->getGeneratedValue());
     return $result;
 }
예제 #16
0
 public function insert($postEntity)
 {
     $result = parent::insert($postEntity);
     $postEntity->setPostId($result->getGeneratedValue());
 }
예제 #17
0
 /**
  * @param object|array $entity
  * @param string|TableIdentifier|null $tableName
  * @param HydratorInterface|null $hydrator
  * @return ResultInterface
  */
 protected function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $result = parent::insert($entity, $tableName, $hydrator);
     return $result;
 }
예제 #18
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);
 }
예제 #19
0
 public function persistProjectPpe($projectPpe)
 {
     return parent::insert($projectPpe, null, new projectPpeHydrator());
 }
예제 #20
0
 public function createSerie($entity)
 {
     $hydrator = new RememberMeHydrator();
     return parent::insert($entity, $this->tableName, $hydrator);
 }
예제 #21
0
 public function persistProjectSubstance($projectSubstance)
 {
     return parent::insert($projectSubstance, null, new projectSubstanceHydrator());
 }
예제 #22
0
 public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $tableName = $this->tableName;
     $result = parent::insert($entity, $tableName, $hydrator);
     return $result;
 }
예제 #23
0
 public function insert($entity, $tableName = null, HydratorInterface $hydrator = null)
 {
     $result = parent::insert($entity, $tableName, $hydrator);
     $entity->setId($result->getGeneratedValue());
     return $result;
 }
예제 #24
0
 public function createEntity($data)
 {
     $result = parent::insert($data);
     return $this->fetchEntity($result->getGeneratedValue());
 }