eZRole Class Reference

The class eZRole does. More...

Inheritance diagram for eZRole:

eZPersistentObject List of all members.

Public Methods

 eZRole ($row=array())
definition ()
 attributes ()
attribute ($attr)
fetchByUser ($idArray)
fetchIDListByUser ($idArray)
cachedRoles ()
 assignToUser ($userID)
fetchUserID ()
 removeUserAssignment ($userID)
fetchUserByRole ()

Detailed Description

The class eZRole does.

Definition at line 49 of file ezrole.php.


Constructor & Destructor Documentation

eZRole::eZRole   row = array()
 

Constructor

Definition at line 54 of file ezrole.php.

References eZPersistentObject::eZPersistentObject().

Referenced by fetchByUser().


Member Function Documentation

eZRole::assignToUser   userID
 

Assigns the current role to the given user or user group identified by the id.

Definition at line 375 of file ezrole.php.

References eZExpiryHandler::instance(), and eZDB::instance().

& eZRole::attribute   attr
 

Returns:
the attribute data for $attr, this is either returned from the member variables or a member function depending on whether the definition field or function attributes matched.

Reimplemented from eZPersistentObject.

Definition at line 80 of file ezrole.php.

References eZPersistentObject::attribute().

eZRole::attributes  
 

Returns:
the attributes for this object, taken from the definition fields and function attributes.

Reimplemented from eZPersistentObject.

Definition at line 75 of file ezrole.php.

References eZPersistentObject::attributes().

& eZRole::cachedRoles  
 

Returns:
the cached roles for the current user. False is returned if roles are not cached.

Definition at line 341 of file ezrole.php.

References eZUser::currentUser(), eZHTTPTool::instance(), and eZExpiryHandler::instance().

Referenced by fetchByUser(), and fetchIDListByUser().

& eZRole::definition  
 

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:
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 59 of file ezrole.php.

& eZRole::fetchByUser   idArray
 

Returns the roles which the corresponds to the array of content object id's ( Users and user group id's ).

Definition at line 246 of file ezrole.php.

References cachedRoles(), eZUser::currentUser(), eZRole(), eZExpiryHandler::instance(), eZHTTPTool::instance(), eZDB::instance(), and eZINI::instance().

Referenced by eZUser::roles().

& eZRole::fetchIDListByUser   idArray
 

Returns a list of role ids which the corresponds to the array of content object id's ( Users and user group id's ).

Definition at line 304 of file ezrole.php.

References cachedRoles(), eZDB::instance(), and eZINI::instance().

Referenced by eZUser::roleIDList().

& eZRole::fetchUserByRole  
 

Returns:
the users and user groups assigned to the current role.

Definition at line 430 of file ezrole.php.

References eZDB::instance().

& eZRole::fetchUserID  
 

Fetch user id array which have been assigned to this role.

Definition at line 400 of file ezrole.php.

References eZDB::instance().

eZRole::removeUserAssignment   userID
 

Removes the role assignment

Definition at line 418 of file ezrole.php.

References eZDB::instance().


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

Exponential copyright © copyright © 1998-2025 Exponential