/**
  * @param AdvancedUserAccountInterface $account
  * @return void
  */
 public function encodePassword(AdvancedUserAccountInterface $account)
 {
     if (null === $account->getPassword()) {
         $account->setPassword('');
     }
     if (0 !== strlen($password = $account->getPlainPassword())) {
         $encoder = $this->getEncoder($account);
         $account->setPassword($encoder->encodePassword($password, $account->getSalt()));
     }
     $account->eraseCredentials();
 }
 /**
  * @param AdvancedUserAccountInterface $account
  * @return bool
  */
 public function isAccount(AdvancedUserAccountInterface $account = null)
 {
     return null !== $account && $this->getId() === $account->getId();
 }