Auth_Yadis_Service::getPriority PHP Method

getPriority() public method

Returns the "priority" attribute value of this element, if the attribute is present. Returns null if not.
public getPriority ( ) : mixed
return mixed $result Null or integer, depending on whether this Service element has a 'priority' attribute.
    function getPriority()
    {
        $attributes = $this->parser->attributes($this->element);
        if (array_key_exists('priority', $attributes)) {
            return intval($attributes['priority']);
        }
        return null;
    }

Usage Example

示例#1
0
 /**
  * Creates the service list using nodes from the XRDS XML
  * document.
  *
  * @access private
  */
 function _parse()
 {
     $this->serviceList = array();
     $services = $this->parser->evalXPath('xrd:Service', $this->xrdNode);
     /*
      * Keyboard Monkeys modification:
      * Assigning the return value of new by reference is deprecated
      */
     foreach ($services as $node) {
         $s = new Auth_Yadis_Service();
         $s->element = $node;
         $s->parser = $this->parser;
         $priority = $s->getPriority();
         if ($priority === null) {
             $priority = SERVICES_YADIS_MAX_PRIORITY;
         }
         $this->_addService($priority, $s);
     }
 }
All Usage Examples Of Auth_Yadis_Service::getPriority