/** * {@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; }
/** * {@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; }
/** * 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; }