Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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

## Public Member Functions
| __construct ()
| variableArray ( $name, $group=false)

## Static Public Member Functions
static | variable ( $name, $group=false)
static | setVariable ( $name, $value, $group=false)

## Detailed Description

! eZSession eZPreferences handles preferences variables.

If you call preferences when there is no user logged in, it allways returns 0;

// include the code
// include_once( "ezsession/classes/ezpreferences.php" );
// set the preferences
$preferences = new eZPreferences();
$preferences->setVariable( "Color", "Blue" );
// get the preferences
$preferences = new eZPreferences();
$color =& $preferences->variable( "Color" );
if ( $color )
{
print( "the user prefers a color: $color" );
}
else
{
print( "the user has no preferences" );
}
eZPreferences
Definition: ezpreferences.php:62
$preferences
$preferences
Definition: classes/admin/linklist.php:186

Definition at line 61 of file ezpreferences.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZPreferences::__construct | ( |  | ) |

Creates a new eZPreferences object.

It will automatically fetch the currently logged in user.

Definition at line 68 of file ezpreferences.php.

## Member Function Documentation

## ◆ setVariable()

static eZPreferences::setVariable | ( |  | $name,
|  |  | $value,
|  |  | $group = `false`
| ) |  |
| static

Adds or updates a variable to the preferences.

Returns false if unsuccessful.

Definition at line 128 of file ezpreferences.php.

References $db, $group, $name, $res, $ret, $user, $userID, eZUser\currentUser(), and eZDB\globalDatabase().

## ◆ variable()

static eZPreferences::variable | ( |  | $name,
|  |  | $group = `false`
| ) |  |
| static

Returns the value of a preferences variable.

If the variable does not exist 0 (false) is returned.

Definition at line 95 of file ezpreferences.php.

References $db, $group, $ret, $user, $userID, eZUser\currentUser(), and eZDB\globalDatabase().

Referenced by variableArray().

## ◆ variableArray()

eZPreferences::variableArray | ( |  | $name,
|  |  | $group = `false`
| ) |  |

Returns the value of a preferences variable as an array.

If the variable does not exist 0 (false) is returned.

Definition at line 78 of file ezpreferences.php.

References $group, $name, and variable().

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

- ezpreferences.php

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