update() 공개 메소드

Updates an object into the database.
public update ( object $entity, string[] $exclusions = [] ) : boolean
$entity object The entity to update.
$exclusions string[] Ignore updates to these fields
리턴 boolean
예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function update($entity, $exclusions = [])
 {
     // Forget remembered users.
     $this->userEntities = [];
     if ($entity->getPassword() === null) {
         $result = parent::update($entity, ['password']);
     } else {
         $result = parent::update($entity);
     }
     return $result;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function update($entity, $exclusions = [])
 {
     $password = $entity->getPassword();
     // PHP 5.4 compatibility
     if (empty($password) || $entity->getPassword() === '**dontchange**') {
         $result = parent::update($entity, ['password']);
     } else {
         $result = parent::update($entity);
     }
     return $result;
 }
예제 #3
0
 /**
  * Saves a single object that already exists.
  *
  * @param object $entity The entity to save.
  *
  * @return boolean
  */
 public function update($entity)
 {
     $password = $entity->getPassword();
     // PHP 5.4 compatibility
     if (empty($password) || $entity->getPassword() === '**dontchange**') {
         $this->getPersister()->disableField('password');
         $result = parent::update($entity);
         $this->getPersister()->enableField('password');
     } else {
         $result = parent::update($entity);
     }
     return $result;
 }