Auth_Yadis_Service Klassenreferenz


Öffentliche Methoden

 Auth_Yadis_Service ()
 getTypes ()
 matchTypes ($type_uris)
 getURIs ()
 getPriority ()
 getElements ($name)

Ausführliche Beschreibung

Definiert in Zeile 83 der Datei XRDS.php.


Dokumentation der Elementfunktionen

Creates an empty service object.

Definiert in Zeile 88 der Datei XRDS.php.

00089     {
00090         $this->element = null;
00091         $this->parser = null;
00092     }

getElements ( name  ) 

Used to get XML elements from this object's <Service> element.

This is what you should use to get all custom information out of this element. This is used by service filter functions to determine whether a service element contains specific tags, etc. NOTE: this only considers elements which are direct children of the <Service> element for this object.

Parameter:
string $name The name of the element to look for
Rückgabe:
array $list An array of elements with the specified name which are direct children of the <Service> element. The nodes returned by this function can be passed to $this->parser methods (see Auth_Yadis_XMLParser).

Definiert in Zeile 201 der Datei XRDS.php.

00202     {
00203         return $this->parser->evalXPath($name, $this->element);
00204     }

getPriority (  ) 

Returns the "priority" attribute value of this <Service> element, if the attribute is present. Returns null if not.

Rückgabe:
mixed $result Null or integer, depending on whether this Service element has a 'priority' attribute.

Definiert in Zeile 175 der Datei XRDS.php.

00176     {
00177         $attributes = $this->parser->attributes($this->element);
00178 
00179         if (array_key_exists('priority', $attributes)) {
00180             return intval($attributes['priority']);
00181         }
00182 
00183         return null;
00184     }

getTypes (  ) 

Return the URIs in the "Type" elements, if any, of this Service element.

Rückgabe:
array $type_uris An array of Type URI strings.

Definiert in Zeile 100 der Datei XRDS.php.

00101     {
00102         $t = array();
00103         foreach ($this->getElements('xrd:Type') as $elem) {
00104             $c = $this->parser->content($elem);
00105             if ($c) {
00106                 $t[] = $c;
00107             }
00108         }
00109         return $t;
00110     }

getURIs (  ) 

Return the URIs in the "URI" elements, if any, of this Service element. The URIs are returned sorted in priority order.

Rückgabe:
array $uris An array of URI strings.

Definiert in Zeile 131 der Datei XRDS.php.

00132     {
00133         $uris = array();
00134         $last = array();
00135 
00136         foreach ($this->getElements('xrd:URI') as $elem) {
00137             $uri_string = $this->parser->content($elem);
00138             $attrs = $this->parser->attributes($elem);
00139             if ($attrs &&
00140                 array_key_exists('priority', $attrs)) {
00141                 $priority = intval($attrs['priority']);
00142                 if (!array_key_exists($priority, $uris)) {
00143                     $uris[$priority] = array();
00144                 }
00145 
00146                 $uris[$priority][] = $uri_string;
00147             } else {
00148                 $last[] = $uri_string;
00149             }
00150         }
00151 
00152         $keys = array_keys($uris);
00153         sort($keys);
00154 
00155         // Rebuild array of URIs.
00156         $result = array();
00157         foreach ($keys as $k) {
00158             $new_uris = Auth_Yadis_array_scramble($uris[$k]);
00159             $result = array_merge($result, $new_uris);
00160         }
00161 
00162         $result = array_merge($result,
00163                               Auth_Yadis_array_scramble($last));
00164 
00165         return $result;
00166     }

matchTypes ( type_uris  ) 

Definiert in Zeile 112 der Datei XRDS.php.

00113     {
00114         $result = array();
00115 
00116         foreach ($this->getTypes() as $typ) {
00117             if (in_array($typ, $type_uris)) {
00118                 $result[] = $typ;
00119             }
00120         }
00121 
00122         return $result;
00123     }


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved.
MyOOS [Shopsystem] is Free Software released under the GNU/GPL License.

Webmaster: info@r23.de (Impressum)
doxygen