eZ Publish  [4.2]
eZHTTPPersistence Class Reference

Object persistence using HTTP post variables. More...

List of all members.

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)

Detailed Description

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.


Member Function Documentation

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.

Parameters:
defThe definition of the objects, uses the same syntax as eZPersistentObject
httpThe 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]
Deprecated:
This function has some serious flaws and will be removed in a future release Goes trough all fields defined in $def and tries to find a post variable which is named $base_name, field name and "checked" with _ between items. If the post variable is an array the id of the current object is matched against that array, if one is found the matched field is set to be true otherwise false. If no post variable was found with that signature the field is ignored. Example of name:
       In the HTML code use:<br/>
       <input type="checkbox" name="ContentClassAttribute_is_searchable_checked[]" value="some_id" />
Parameters:
defThe 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().

Deprecated:
This function has some serious flaws and will be removed in a future release

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.

Parameters:
httpThe eZHTTPTool object

Definition at line 177 of file ezhttppersistence.php.


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