Öffentliche Methoden | |
Auth_OpenID_Mapping ($classic_array=null) | |
isA ($thing) | |
keys () | |
values () | |
items () | |
len () | |
set ($key, $value) | |
get ($key, $default=null) | |
_reflow () | |
del ($key) | |
contains ($value) |
Definiert in Zeile 124 der Datei Message.php.
_reflow | ( | ) |
private
Definiert in Zeile 224 der Datei Message.php.
00226 { 00227 // PHP is broken yet again. Sort the arrays to remove the 00228 // hole in the numeric indexes that make up the array. 00229 $old_keys = $this->keys; 00230 $old_values = $this->values; 00231 00232 $this->keys = array(); 00233 $this->values = array(); 00234 00235 foreach ($old_keys as $k) { 00236 $this->keys[] = $k; 00237 } 00238 00239 foreach ($old_values as $v) { 00240 $this->values[] = $v; 00241 }
Auth_OpenID_Mapping | ( | $ | classic_array = null |
) |
Initialize a mapping. If $classic_array is specified, its keys and values are used to populate the mapping.
Definiert in Zeile 129 der Datei Message.php.
00131 { 00132 $this->keys = array(); 00133 $this->values = array(); 00134 00135 if (is_array($classic_array)) { 00136 foreach ($classic_array as $key => $value) { 00137 $this->set($key, $value); 00138 } 00139 }
contains | ( | $ | value | ) |
Returns true if the specified value has a key in the mapping; false if not.
Definiert in Zeile 264 der Datei Message.php.
00266 { 00267 return (array_search($value, $this->keys) !== false);
del | ( | $ | key | ) |
Deletes a key-value pair from the mapping with the specified key.
Definiert in Zeile 247 der Datei Message.php.
00249 { 00250 $index = array_search($key, $this->keys); 00251 00252 if ($index !== false) { 00253 unset($this->keys[$index]); 00254 unset($this->values[$index]); 00255 $this->_reflow(); 00256 return true; 00257 } 00258 return false;
get | ( | $ | key, | |
$ | default = null | |||
) |
Gets a specified value from the mapping, associated with the specified key. If the key does not exist in the mapping, $default is returned instead.
Definiert in Zeile 210 der Datei Message.php.
00212 { 00213 $index = array_search($key, $this->keys); 00214 00215 if ($index !== false) { 00216 return $this->values[$index]; 00217 } else { 00218 return $default; 00219 }
isA | ( | $ | thing | ) |
Returns true if $thing is an Auth_OpenID_Mapping object; false if not.
Definiert in Zeile 145 der Datei Message.php.
00147 { 00148 return (is_object($thing) && 00149 strtolower(get_class($thing)) == 'auth_openid_mapping');
items | ( | ) |
Returns an array of (key, value) pairs in the mapping.
Definiert in Zeile 170 der Datei Message.php.
00172 { 00173 $temp = array(); 00174 00175 for ($i = 0; $i < count($this->keys); $i++) { 00176 $temp[] = array($this->keys[$i], 00177 $this->values[$i]); 00178 } 00179 return $temp;
keys | ( | ) |
Returns an array of the keys in the mapping.
Definiert in Zeile 154 der Datei Message.php.
00156 { 00157 return $this->keys;
len | ( | ) |
Returns the "length" of the mapping, or the number of keys.
Definiert in Zeile 184 der Datei Message.php.
00186 { 00187 return count($this->keys);
set | ( | $ | key, | |
$ | value | |||
) |
Sets a key-value pair in the mapping. If the key already exists, its value is replaced with the new value.
Definiert in Zeile 193 der Datei Message.php.
00195 { 00196 $index = array_search($key, $this->keys); 00197 00198 if ($index !== false) { 00199 $this->values[$index] = $value; 00200 } else { 00201 $this->keys[] = $key; 00202 $this->values[] = $value; 00203 }
values | ( | ) |
Returns an array of values in the mapping.
Definiert in Zeile 162 der Datei Message.php.
00164 { 00165 return $this->values;
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|