Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | List of all members
eZHTTPPersistence Class Reference

## Public Member Functions
| __construct ()

## Static Public Member Functions
static | fetch ( $base_name, array $def, $objects, eZHTTPTool $http, $is_array, $indexField=false)
static | fetchElement ( $base_name, array $def, $object, eZHTTPTool $http, $index)
static | splitSelected ( $base_name, $objects, eZHTTPTool $http, $cond, &$keepers, &$rejects)

## 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 20 of file ezhttppersistence.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZHTTPPersistence::__construct | ( |  | ) |

Initializes the class.

Definition at line 25 of file ezhttppersistence.php.

## Member Function Documentation

## ◆ fetch()

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_name | Base name for HTTP POST variables
  array | $def | Definition 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_array | If true, $objects is assumed to be an array
  string | false | $indexField | Field name as defined in $def. If provided, will be used to fetch HTTP variables as index.

Returns
  void

Definition at line 42 of file ezhttppersistence.php.

References fetchElement().

## ◆ fetchElement()

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

Helper function for eZHTTPPersistence::fetch()

Parameters

  string | $base_name |
  array | $def | Definition for $object, uses the same syntax as eZPersistentObject
  object | $object |
  eZHTTPTool | $http |
  int | string | false | $index | Index 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

Definition at line 72 of file ezhttppersistence.php.

References eZHTTPTool\hasPostVariable(), eZHTTPTool\postVariable(), and eZDebug\writeDebug().

Referenced by fetch().

## ◆ splitSelected()

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

Definition at line 125 of file ezhttppersistence.php.

References eZHTTPTool\hasPostVariable(), and eZHTTPTool\postVariable().

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

- ezhttppersistence.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.