eZ Publish  [4.2]
eZContentBrowseRecent Class Reference

Handles recent nodes for users. More...

+ Inheritance diagram for eZContentBrowseRecent:
+ Collaboration diagram for eZContentBrowseRecent:

List of all members.

Public Member Functions

 contentObjectID ()
 eZContentBrowseRecent ($row)
 fetchNode ()

Static Public Member Functions

static cleanup ()
static createNew ($userID, $nodeID, $nodeName)
static definition ()
static fetch ($recentID)
static fetchListForUser ($userID)
static maximumRecentItems ($userID)
static removeRecentByNodeID ($nodeID)
static updateNodeID ($oldNodeID, $newNodeID)

Detailed Description

Handles recent nodes for users.

Allows the creation and fetching of recent lists for users. The recent list is used in the browse page to allow quick navigation and selection.

Creating a new recent item is done with

$userID = eZUser::currentUserID();
$nodeID = 2;
$nodeName = 'Node';
eZContentBrowseRecent::createNew( $userID, $nodeID, $nodeName )

Fetching the list is done with

Definition at line 56 of file ezcontentbrowserecent.php.


Member Function Documentation

static eZContentBrowseRecent::cleanup ( ) [static]

Removes all recent entries for all users.

Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 255 of file ezcontentbrowserecent.php.

eZContentBrowseRecent::contentObjectID ( )
Returns:
the content object ID of the tree node which this item refers to.

Definition at line 215 of file ezcontentbrowserecent.php.

static eZContentBrowseRecent::createNew ( userID,
nodeID,
nodeName 
) [static]

Tries to create a new recent item and returns it. If the node ID $nodeID already exists as a recent item nothing is done and the old item is returned.

It will also remove items when the maximum number of items for the user $userID is exceeded.

See also:
maximumRecentItems
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 145 of file ezcontentbrowserecent.php.

static eZContentBrowseRecent::definition ( ) [static]
Returns:
the definition for the object, the default implementation is to return an empty array. It's upto each inheriting class to return a proper definition array.

The definition array is an associative array consists of these keys:

  • fields - an associative array of fields which defines which database field (the key) is to fetched and how they map to object member variables (the value).
  • keys - an array of fields which is used for uniquely identifying the object in the table.
  • function_attributes - an associative array of attributes which maps to member functions, used for fetching data with functions.
  • set_functions - an associative array of attributes which maps to member functions, used for setting data with functions.
  • increment_key - the field which is incremented on table inserts.
  • class_name - the classname which is used for instantiating new objecs when fetching from the database.
  • sort - an associative array which defines the default sorting of lists, the key is the table field while the value is the sorting method which is either asc or desc.
  • name - the name of the database table

Example:

static function definition()
{
    return array( "fields" => array( "id" => "ID",
                                     "version" => "Version",
                                     "name" => "Name" ),
                  "keys" => array( "id", "version" ),
                  "function_attributes" => array( "current" => "currentVersion",
                                                  "class_name" => "className" ),
                  "increment_key" => "id",
                  "class_name" => "eZContentClass",
                  "sort" => array( "id" => "asc" ),
                  "name" => "ezcontentclass" );
}

Reimplemented from eZPersistentObject.

Definition at line 63 of file ezcontentbrowserecent.php.

Referenced by createNew(), fetch(), and fetchListForUser().

eZContentBrowseRecent::eZContentBrowseRecent ( row)

Definition at line 58 of file ezcontentbrowserecent.php.

Referenced by createNew().

static eZContentBrowseRecent::fetch ( recentID) [static]
Returns:
the recent item $recentID

Definition at line 105 of file ezcontentbrowserecent.php.

Referenced by fetchNode().

static eZContentBrowseRecent::fetchListForUser ( userID) [static]
Returns:
the recent list for the user identifier by $userID.

Definition at line 115 of file ezcontentbrowserecent.php.

eZContentBrowseRecent::fetchNode ( )
Returns:
the tree node which this item refers to.

Definition at line 207 of file ezcontentbrowserecent.php.

Referenced by contentObjectID().

static eZContentBrowseRecent::maximumRecentItems ( userID) [static]
Returns:
the maximum number of recent items for user $userID. The default value is read from MaximumRecentItems from group BrowseSettings in browse.ini.
Note:
Currently all users get the same default maximum amount

Definition at line 128 of file ezcontentbrowserecent.php.

Referenced by createNew().

static eZContentBrowseRecent::removeRecentByNodeID ( nodeID) [static]
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 230 of file ezcontentbrowserecent.php.

Referenced by eZContentObjectTreeNode\removeThis().

static eZContentBrowseRecent::updateNodeID ( oldNodeID,
newNodeID 
) [static]
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 241 of file ezcontentbrowserecent.php.


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