getPreferredEntityIdFromCIDRhint() публичный Метод

This method will call getPreferredEntityIdFromCIDRhint() on all of the sources.
public getPreferredEntityIdFromCIDRhint ( string $set, string $ip ) : string
$set string Which set of metadata we are looking it up in.
$ip string IP address
Результат string The entity id of a entity which have a CIDR hint where the provided IP address match.
Пример #1
0
 /**
  * Retrieve a recommended IdP based on the IP address of the client.
  *
  * @return string|null  The entity ID of the IdP if one is found, or null if not.
  */
 protected function getFromCIDRhint()
 {
     foreach ($this->metadataSets as $metadataSet) {
         $idp = $this->metadata->getPreferredEntityIdFromCIDRhint($metadataSet, $_SERVER['REMOTE_ADDR']);
         if (!empty($idp)) {
             return $idp;
         }
     }
     return null;
 }