|
eZ Publish
[4.2]
|
Object persistence using HTTP post variables. More...
Public Member Functions | |
| eZHTTPPersistence () | |
Static Public Member Functions | |
| static | fetch ($base_name, $def, $objects, $http, $is_array) |
| static | handleChecked ($base_name, $def, $objects, $http, $is_array=true) |
| static | splitSelected ($base_name, $objects, $http, $cond, &$keepers, &$rejects) |
Static Private Member Functions | |
| static | fetchElement ($base_name, $def, $object, $http, $index) |
| static | handleCheckedElement ($base_name, $def, $object, $http) |
Object persistence using HTTP post variables.
This class allows objects or data to exist between page views. It can read HTTP post variables and set them in existing objects to override data. This is useful if you want to keep changes in a page but don't want to store the changes in a DB. It also makes it easier to fetch the changes by the user before an object is stored.
Definition at line 44 of file ezhttppersistence.php.
| eZHTTPPersistence::eZHTTPPersistence | ( | ) |
Initializes the class.
Definition at line 49 of file ezhttppersistence.php.
| static eZHTTPPersistence::fetch | ( | $ | base_name, |
| $ | def, | ||
| $ | objects, | ||
| $ | http, | ||
| $ | is_array | ||
| ) | [static] |
Fetches the HTTP post variables using the base name $base_name and stores them in the object $objects, if $is_array is true then $objects is assumed to be an array and all objects are updated.
| def | The definition of the objects, uses the same syntax as eZPersistentObject |
| http | The eZHTTPTool object |
Definition at line 58 of file ezhttppersistence.php.
Referenced by eZContentObjectStateGroup\fetchHTTPPersistentVariables(), and eZContentObjectState\fetchHTTPPersistentVariables().
| static eZHTTPPersistence::fetchElement | ( | $ | base_name, |
| $ | def, | ||
| $ | object, | ||
| $ | http, | ||
| $ | index | ||
| ) | [static, private] |
Helper function for fetch().
Definition at line 82 of file ezhttppersistence.php.
Referenced by fetch().
| static eZHTTPPersistence::handleChecked | ( | $ | base_name, |
| $ | def, | ||
| $ | objects, | ||
| $ | http, | ||
| $ | is_array = true |
||
| ) | [static] |
In the HTML code use:<br/>
<input type="checkbox" name="ContentClassAttribute_is_searchable_checked[]" value="some_id" />
| def | The definition of the objects, uses the same syntax as eZPersistentObject |
Definition at line 117 of file ezhttppersistence.php.
| static eZHTTPPersistence::handleCheckedElement | ( | $ | base_name, |
| $ | def, | ||
| $ | object, | ||
| $ | http | ||
| ) | [static, private] |
Helper function for handleChecked().
Definition at line 140 of file ezhttppersistence.php.
Referenced by handleChecked().
| static eZHTTPPersistence::splitSelected | ( | $ | base_name, |
| $ | objects, | ||
| $ | http, | ||
| $ | cond, | ||
| &$ | keepers, | ||
| &$ | rejects | ||
| ) | [static] |
Loops over the HTTP post variables with $base_name as the base. It examines the HTTP post variable $base_name "_" $cond "_checked" which should contain an array of ids. The ids are then matched against the objects attribute $cond. If they match the object is moved to the $rejects array otherwise the $keepers array.
| http | The eZHTTPTool object |
Definition at line 177 of file ezhttppersistence.php.