update() public method

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
return boolean
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
 }