ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Auth_OpenID_Mapping Class Reference
+ Collaboration diagram for Auth_OpenID_Mapping:

Public Member Functions

 Auth_OpenID_Mapping ($classic_array=null)
 Initialize a mapping. More...
 
 keys ()
 Returns an array of the keys in the mapping. More...
 
 values ()
 Returns an array of values in the mapping. More...
 
 items ()
 Returns an array of (key, value) pairs in the mapping. More...
 
 len ()
 Returns the "length" of the mapping, or the number of keys. More...
 
 set ($key, $value)
 Sets a key-value pair in the mapping. More...
 
 get ($key, $default=null)
 Gets a specified value from the mapping, associated with the specified key. More...
 
 _reflow ()
 @access private More...
 
 del ($key)
 Deletes a key-value pair from the mapping with the specified key. More...
 
 contains ($value)
 Returns true if the specified value has a key in the mapping; false if not. More...
 

Static Public Member Functions

static isA ($thing)
 Returns true if $thing is an Auth_OpenID_Mapping object; false if not. More...
 

Detailed Description

Definition at line 124 of file Message.php.

Member Function Documentation

◆ _reflow()

Auth_OpenID_Mapping::_reflow ( )

@access private

Definition at line 224 of file Message.php.

226 {
227 // PHP is broken yet again. Sort the arrays to remove the
228 // hole in the numeric indexes that make up the array.
229 $old_keys = $this->keys;
230 $old_values = $this->values;
231
232 $this->keys = array();
233 $this->values = array();
234
235 foreach ($old_keys as $k) {
236 $this->keys[] = $k;
237 }
238
239 foreach ($old_values as $v) {
240 $this->values[] = $v;
241 }
values()
Returns an array of values in the mapping.
Definition: Message.php:162
keys()
Returns an array of the keys in the mapping.
Definition: Message.php:154

◆ Auth_OpenID_Mapping()

Auth_OpenID_Mapping::Auth_OpenID_Mapping (   $classic_array = null)

Initialize a mapping.

If $classic_array is specified, its keys and values are used to populate the mapping.

Definition at line 129 of file Message.php.

131 {
132 $this->keys = array();
133 $this->values = array();
134
135 if (is_array($classic_array)) {
136 foreach ($classic_array as $key => $value) {
137 $this->set($key, $value);
138 }
139 }

◆ contains()

Auth_OpenID_Mapping::contains (   $value)

Returns true if the specified value has a key in the mapping; false if not.

Definition at line 264 of file Message.php.

266 {
267 return (array_search($value, $this->keys) !== false);

◆ del()

Auth_OpenID_Mapping::del (   $key)

Deletes a key-value pair from the mapping with the specified key.

Definition at line 247 of file Message.php.

249 {
250 $index = array_search($key, $this->keys);
251
252 if ($index !== false) {
253 unset($this->keys[$index]);
254 unset($this->values[$index]);
255 $this->_reflow();
256 return true;
257 }
258 return false;
_reflow()
@access private
Definition: Message.php:224

◆ get()

Auth_OpenID_Mapping::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.

Definition at line 210 of file Message.php.

212 {
213 $index = array_search($key, $this->keys);
214
215 if ($index !== false) {
216 return $this->values[$index];
217 } else {
218 return $default;
219 }

◆ isA()

static Auth_OpenID_Mapping::isA (   $thing)
static

Returns true if $thing is an Auth_OpenID_Mapping object; false if not.

Definition at line 145 of file Message.php.

147 {
148 return (is_object($thing) &&
149 strtolower(get_class($thing)) == 'auth_openid_mapping');

◆ items()

Auth_OpenID_Mapping::items ( )

Returns an array of (key, value) pairs in the mapping.

Definition at line 170 of file Message.php.

172 {
173 $temp = array();
174
175 for ($i = 0; $i < count($this->keys); $i++) {
176 $temp[] = array($this->keys[$i],
177 $this->values[$i]);
178 }
179 return $temp;

◆ keys()

Auth_OpenID_Mapping::keys ( )

Returns an array of the keys in the mapping.

Definition at line 154 of file Message.php.

156 {
157 return $this->keys;

◆ len()

Auth_OpenID_Mapping::len ( )

Returns the "length" of the mapping, or the number of keys.

Definition at line 184 of file Message.php.

186 {
187 return count($this->keys);

◆ set()

Auth_OpenID_Mapping::set (   $key,
  $value 
)

Sets a key-value pair in the mapping.

If the key already exists, its value is replaced with the new value.

Definition at line 193 of file Message.php.

195 {
196 $index = array_search($key, $this->keys);
197
198 if ($index !== false) {
199 $this->values[$index] = $value;
200 } else {
201 $this->keys[] = $key;
202 $this->values[] = $value;
203 }

◆ values()

Auth_OpenID_Mapping::values ( )

Returns an array of values in the mapping.

Definition at line 162 of file Message.php.

164 {
165 return $this->values;

The documentation for this class was generated from the following file: