LdapTools\Connection\LastErrorStrategy::getInstance PHP Method

getInstance() public static method

public static getInstance ( string $type, resource $connection ) : ADLastErrorStrategy | LastErrorStrategy
$type string
$connection resource
return LdapTools\Connection\AD\ADLastErrorStrategy | LastErrorStrategy
    public static function getInstance($type, $connection)
    {
        if (LdapConnection::TYPE_AD == $type) {
            return new ADLastErrorStrategy($connection);
        } else {
            return new self($connection);
        }
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function getDiagnosticMessage()
 {
     return LastErrorStrategy::getInstance($this->config->getLdapType(), $this->connection)->getDiagnosticMessage();
 }