public function setPassword($password)
    {
        if ($this->isNew() && ($password === null || trim($password) == "")) {
            throw new InvalidArgumentException("customer password is mandatory on creation");
        }

        if ($password !== null && trim($password) != "") {
            $this->setAlgo("PASSWORD_BCRYPT");

            parent::setPassword(password_hash($password, PASSWORD_BCRYPT));
        }

        return $this;
    }
public function setPassword($password)
    {
        if ($this->isNew() && ($password === null || trim($password) == "")) {
            throw new InvalidArgumentException("customer password is mandatory on creation");
        }

        if ($password !== null && trim($password) != "") {
            $this->setAlgo("PASSWORD_BCRYPT");

            parent::setPassword(password_hash($password, PASSWORD_BCRYPT));
        }

        return $this;
    }
public function setPassword ( $ password ) { if ( $ this -> isNew ( ) && ( $ password === null || trim ( $ password ) == "" ) ) { throw new InvalidArgumentException ( "customer password is mandatory on creation" ) ; } if ( $ password !== null && trim ( $ password ) != "" ) { $ this -> setAlgo ( "PASSWORD_BCRYPT" ) ; parent :: setPassword ( password_hash ( $ password , PASSWORD_BCRYPT ) ) ; } return $ this ; }
create hash for plain password and set it in Customer object

@param  string                             $password plain password before hashing
@throws Exception\InvalidArgumentException
@return $this|Customer
create hash for plain password and set it in Customer object