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

Public Member Functions

 check ($data)
 Override this. More...
 
 fromSession ($data)
 Given a session data value (an array), this creates an object (returned by $this->newObject()) whose attributes and values are those in $data. More...
 
 prepareForLoad ($data)
 Prepares the data array by making any necessary changes. More...
 
 newObject ($data)
 Returns a new instance of this loader's class, using the session data to construct it if necessary. More...
 
 toSession ($obj)
 Returns an array of keys and values built from the attributes of $obj. More...
 
 prepareForSave ($obj)
 Override this. More...
 

Detailed Description

Definition at line 76 of file Manager.php.

Member Function Documentation

◆ check()

Auth_Yadis_SessionLoader::check (   $data)

Override this.

@access private

Reimplemented in Auth_OpenID_ServiceEndpointLoader, and Auth_Yadis_ManagerLoader.

Definition at line 82 of file Manager.php.

83 {
84 return true;
85 }

Referenced by fromSession().

+ Here is the caller graph for this function:

◆ fromSession()

Auth_Yadis_SessionLoader::fromSession (   $data)

Given a session data value (an array), this creates an object (returned by $this->newObject()) whose attributes and values are those in $data.

Returns null if $data lacks keys found in $this->requiredKeys(). Returns null if $this->check($data) evaluates to false. Returns null if $this->newObject() evaluates to false.

@access private

Definition at line 97 of file Manager.php.

98 {
99 if (!$data) {
100 return null;
101 }
102
103 $required = $this->requiredKeys();
104
105 foreach ($required as $k) {
106 if (!array_key_exists($k, $data)) {
107 return null;
108 }
109 }
110
111 if (!$this->check($data)) {
112 return null;
113 }
114
115 $data = array_merge($data, $this->prepareForLoad($data));
116 $obj = $this->newObject($data);
117
118 if (!$obj) {
119 return null;
120 }
121
122 foreach ($required as $k) {
123 $obj->$k = $data[$k];
124 }
125
126 return $obj;
127 }
newObject($data)
Returns a new instance of this loader's class, using the session data to construct it if necessary.
Definition: Manager.php:149
prepareForLoad($data)
Prepares the data array by making any necessary changes.
Definition: Manager.php:136
check($data)
Override this.
Definition: Manager.php:82
$data

References $data, check(), newObject(), and prepareForLoad().

+ Here is the call graph for this function:

◆ newObject()

Auth_Yadis_SessionLoader::newObject (   $data)

Returns a new instance of this loader's class, using the session data to construct it if necessary.

The object need only be created; $this->fromSession() will take care of setting the object's attributes.

@access private

Reimplemented in Auth_OpenID_ServiceEndpointLoader, and Auth_Yadis_ManagerLoader.

Definition at line 149 of file Manager.php.

150 {
151 return null;
152 }

Referenced by fromSession().

+ Here is the caller graph for this function:

◆ prepareForLoad()

Auth_Yadis_SessionLoader::prepareForLoad (   $data)

Prepares the data array by making any necessary changes.

Returns an array whose keys and values will be used to update the original data array before calling $this->newObject($data).

@access private

Reimplemented in Auth_Yadis_ManagerLoader.

Definition at line 136 of file Manager.php.

137 {
138 return array();
139 }

Referenced by fromSession().

+ Here is the caller graph for this function:

◆ prepareForSave()

Auth_Yadis_SessionLoader::prepareForSave (   $obj)

Override this.

@access private

Reimplemented in Auth_Yadis_ManagerLoader.

Definition at line 185 of file Manager.php.

186 {
187 return array();
188 }

Referenced by toSession().

+ Here is the caller graph for this function:

◆ toSession()

Auth_Yadis_SessionLoader::toSession (   $obj)

Returns an array of keys and values built from the attributes of $obj.

If $this->prepareForSave($obj) returns an array, its keys and values are used to update the $data array of attributes from $obj.

@access private

Definition at line 162 of file Manager.php.

163 {
164 $data = array();
165 foreach ($obj as $k => $v) {
166 $data[$k] = $v;
167 }
168
169 $extra = $this->prepareForSave($obj);
170
171 if ($extra && is_array($extra)) {
172 foreach ($extra as $k => $v) {
173 $data[$k] = $v;
174 }
175 }
176
177 return $data;
178 }
prepareForSave($obj)
Override this.
Definition: Manager.php:185

References $data, and prepareForSave().

+ Here is the call graph for this function:

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