eZPublishCommunityProject(LegacyStack)  2013.6
eZHTTPPersistence Class Reference

Object persistence using HTTP post variables. More...

Public Member Functions

 __construct ()
 Initializes the class. More...
 

Static Public Member Functions

static fetch ($base_name, array $def, $objects, eZHTTPTool $http, $is_array, $indexField=false)
 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. More...
 
static fetchElement ($base_name, array $def, $object, eZHTTPTool $http, $index)
 Helper function for eZHTTPPersistence::fetch(). More...
 
static splitSelected ($base_name, $objects, eZHTTPTool $http, $cond, &$keepers, &$rejects)
 Loops over the HTTP post variables with $base_name as the base. More...
 

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.

Constructor & Destructor Documentation

eZHTTPPersistence::__construct ( )

Initializes the class.

Member Function Documentation

static eZHTTPPersistence::fetch (   $base_name,
array  $def,
  $objects,
eZHTTPTool  $http,
  $is_array,
  $indexField = false 
)
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
string$base_nameBase name for HTTP POST variables
array$defDefinition for $objects, uses the same syntax as eZPersistentObject
object|object[]Single object or array of objects having the same definition provided in $def
eZHTTPTool
bool$is_arrayIf true, $objects is assumed to be an array
string | false$indexFieldField name as defined in $def. If provided, will be used to fetch HTTP variables as index.
Returns
void

Referenced by eZContentObjectStateGroup\fetchHTTPPersistentVariables(), and eZContentObjectState\fetchHTTPPersistentVariables().

static eZHTTPPersistence::fetchElement (   $base_name,
array  $def,
  $object,
eZHTTPTool  $http,
  $index 
)
static

Helper function for eZHTTPPersistence::fetch().

Parameters
string$base_name
array$defDefinition for $object, uses the same syntax as eZPersistentObject
object$object
eZHTTPTool$http
int | string | false$indexIndex in HTTP POST data corresponding to $object. Set as string will make use of corresponding field in $def Set to false if posted data is not an array.
See Also
eZHTTPPersistence::fetch()
Returns
void

Referenced by fetch().

static eZHTTPPersistence::splitSelected (   $base_name,
  $objects,
eZHTTPTool  $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
string$base_name
object[]$objects
eZHTTPTool$http
$cond
$keepers
$rejects
Returns
boolean

Referenced by removeSelectedGroups().


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