ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_Mapping Class Reference
+ Collaboration diagram for Auth_OpenID_Mapping:

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Definition at line 124 of file Message.php.

Member Function Documentation

Auth_OpenID_Mapping::_reflow ( )

private

Definition at line 224 of file Message.php.

{
// PHP is broken yet again. Sort the arrays to remove the
// hole in the numeric indexes that make up the array.
$old_keys = $this->keys;
$old_values = $this->values;
$this->keys = array();
$this->values = array();
foreach ($old_keys as $k) {
$this->keys[] = $k;
}
foreach ($old_values as $v) {
$this->values[] = $v;
}
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.

{
$this->keys = array();
$this->values = array();
if (is_array($classic_array)) {
foreach ($classic_array as $key => $value) {
$this->set($key, $value);
}
}
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.

{
return (array_search($value, $this->keys) !== false);
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.

{
$index = array_search($key, $this->keys);
if ($index !== false) {
unset($this->keys[$index]);
unset($this->values[$index]);
$this->_reflow();
return true;
}
return false;
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.

{
$index = array_search($key, $this->keys);
if ($index !== false) {
return $this->values[$index];
} else {
return $default;
}
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.

{
return (is_object($thing) &&
strtolower(get_class($thing)) == 'auth_openid_mapping');
Auth_OpenID_Mapping::items ( )

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

Definition at line 170 of file Message.php.

{
$temp = array();
for ($i = 0; $i < count($this->keys); $i++) {
$temp[] = array($this->keys[$i],
$this->values[$i]);
}
return $temp;
Auth_OpenID_Mapping::keys ( )

Returns an array of the keys in the mapping.

Definition at line 154 of file Message.php.

{
return $this->keys;
Auth_OpenID_Mapping::len ( )

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

Definition at line 184 of file Message.php.

{
return count($this->keys);
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.

{
$index = array_search($key, $this->keys);
if ($index !== false) {
$this->values[$index] = $value;
} else {
$this->keys[] = $key;
$this->values[] = $value;
}
Auth_OpenID_Mapping::values ( )

Returns an array of values in the mapping.

Definition at line 162 of file Message.php.

{
return $this->values;

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