Vilma_Driver::getAddressInfo PHP Method

getAddressInfo() public method

This method may be overridden by the backend driver if there is a more efficient way to do this than a linear array search.
public getAddressInfo ( string $address, string $type = 'all' ) : array
$address string Address for which information will be pulled.
$type string Address type to request. One of 'all', 'user', 'alias', 'forward' or 'group'.
return array Array of user information on success or empty array if the user does not exist.
    public function getAddressInfo($address, $type = 'all')
    {
        $domain = Vilma::stripDomain($address);
        $addresses = $this->getAddresses($domain, $type);
        foreach ($addresses as $addrinfo) {
            if ($addrinfo['id'] == $address || $addrinfo['address'] == $address) {
                return $addrinfo;
            }
        }
        throw new Vilma_Exception(sprintf(_("No such address %s of type %s found."), $address, $type));
    }