LdapTools\Object\LdapObject::resolveAttributeName PHP Method

resolveAttributeName() protected method

Retrieve the attribute in the case it exists in the array.
protected resolveAttributeName ( string $attribute ) : string
$attribute string
return string
    protected function resolveAttributeName($attribute)
    {
        $result = preg_grep("/^{$attribute}\$/i", array_keys($this->attributes));
        if (empty($result)) {
            throw new InvalidArgumentException(sprintf('Unable to resolve attribute "%s".', $attribute));
        }
        return reset($result);
    }