LdapTools\Connection\LastErrorStrategy::getLastErrorMessage PHP Method

getLastErrorMessage() public method

Get the last error message from LDAP.
public getLastErrorMessage ( ) : string
return string
    public function getLastErrorMessage()
    {
        return ldap_error($this->connection);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function getLastErrorMessage()
 {
     $extendedError = $this->getExtendedErrorNumber();
     if (array_key_exists($extendedError, ADResponseCodes::RESPONSE_MESSAGE)) {
         $message = ADResponseCodes::RESPONSE_MESSAGE[$extendedError];
     } else {
         $message = parent::getLastErrorMessage();
     }
     return $message;
 }