public function preUpdate(PreUpdateEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();

        if ($this->checkEntityType($entity)) {
            if ($eventArgs->hasChangedField('password')) {
                $password = $entity->getPassword();
                if (!empty($password)) {
                    $encodedPassword = $this->encryptPassword($password);
                    $eventArgs->setNewValue('password', $encodedPassword);
                }
            }
        }
    }
public function preUpdate(PreUpdateEventArgs $eventArgs)
    {
        $entity = $eventArgs->getEntity();

        if ($this->checkEntityType($entity)) {
            if ($eventArgs->hasChangedField('password')) {
                $password = $entity->getPassword();
                if (!empty($password)) {
                    $encodedPassword = $this->encryptPassword($password);
                    $eventArgs->setNewValue('password', $encodedPassword);
                }
            }
        }
    }
public function preUpdate ( PreUpdateEventArgs $ eventArgs ) { $ entity = $ eventArgs -> getEntity ( ) ; if ( $ this -> checkEntityType ( $ entity ) ) { if ( $ eventArgs -> hasChangedField ( 'password' ) ) { $ password = $ entity -> getPassword ( ) ; if ( ! empty ( $ password ) ) { $ encodedPassword = $ this -> encryptPassword ( $ password ) ; $ eventArgs -> setNewValue ( 'password' , $ encodedPassword ) ; } } } }
PreUpdate event listener.

Only computes password change if password is one of file to be changed

@param PreUpdateEventArgs $eventArgs Event args
PreUpdate event listener .