public function firstValueOf(string $name): AttributeValue
    {
        $oid = AttributeType::attrNameToOID($name);
        foreach ($this->_rdns as $rdn) {
            $tvs = $rdn->allOf($oid);
            if (count($tvs) > 1) {
                throw new \RangeException("RDN with multiple $name attributes.");
            }
            if (1 == count($tvs)) {
                return $tvs[0]->value();
            }
        }
        throw new \RangeException("Attribute $name not found.");
    }
public function firstValueOf(string $name): AttributeValue
    {
        $oid = AttributeType::attrNameToOID($name);
        foreach ($this->_rdns as $rdn) {
            $tvs = $rdn->allOf($oid);
            if (count($tvs) > 1) {
                throw new \RangeException("RDN with multiple $name attributes.");
            }
            if (1 == count($tvs)) {
                return $tvs[0]->value();
            }
        }
        throw new \RangeException("Attribute $name not found.");
    }
public function firstValueOf ( string $ name ) : AttributeValue { $ oid = AttributeType :: attrNameToOID ( $ name ) ; foreach ( $ this -> _rdns as $ rdn ) { $ tvs = $ rdn -> allOf ( $ oid ) ; if ( count ( $ tvs ) > 1 ) { throw new \ RangeException ( "RDN with multiple $name attributes." ) ; } if ( 1 == count ( $ tvs ) ) { return $ tvs [ 0 ] -> value ( ) ; } } throw new \ RangeException ( "Attribute $name not found." ) ; }
Get the first AttributeValue of given type.

Relative name components shall be traversed in encoding order, which is
reversed in regards to the string representation.
Multi-valued RDN with multiple attributes of the requested type is
ambiguous and shall throw an exception.

@param string $name Attribute OID or name
@throws \RuntimeException If attribute cannot be resolved
@return AttributeValue
Get the first AttributeValue of given type .