eZ Publish  [4.2]
eZContentClassAttribute Class Reference

Encapsulates data for a class attribute. More...

+ Inheritance diagram for eZContentClassAttribute:
+ Collaboration diagram for eZContentClassAttribute:

List of all members.

Public Member Functions

 __clone ()
 content ()
 currentModule ()
 customHTTPAction ($module, $http, $action)
 dataType ()
 diff ($old, $new)
 displayInfo ()
 eZContentClassAttribute ($row)
 initializeObjectAttributes (&$objects=null)
 instantiate ($contentobjectID, $languageCode=false, $version=1)
 instantiateTemporary ($contentobjectID=false)
 move ($down, $params=null)
 name ($languageLocale=false)
 nameList ()
 removeThis ($quiet=false)
 removeTranslation ($languageLocale)
 setAlwaysAvailableLanguage ($languageLocale)
 setContent ($content)
 setName ($name, $languageLocale=false)
 store ($fieldFilters=null)
 storeDefined ()

Static Public Member Functions

static cachedInfo ()
static classAttributeIDByIdentifier ($identifier)
 Resolves the string class attribute identifier $identifier to its numeric value Use eZContentObjectTreeNode::classAttributeIDByIdentifier() for < 4.1.
static classAttributeIdentifierByID ($id)
 Resolves the numeric class attribute identifier $id to its string value.
static create ($class_id, $data_type_string, $optionalValues=array(), $languageLocale=false)
static dataTypeByID ($classAttributeID)
static definition ()
static expireCache ($contentClassAttributeID=false, $contentClassID=false)
 Clears all content class attribute related caches.
static fetch ($id, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $field_filters=null)
static fetchFilteredList ($cond, $asObject=true)
static fetchList ($asObject=true, $parameters=array())
static fetchListByClassID ($classID, $version=eZContentClass::VERSION_STATUS_DEFINED, $asObject=true)
static nameFromSerializedString ($serializedNameList, $languageLocale=false)
static sortKeyTypeByID ($classAttributeID)

Public Attributes

 $Content
 Contains the content for this attribute.
 $ContentClassID
 $DataTypeString
 $DisplayInfo
 Contains information on how to display the current attribute in various viewmodes.
 $ID
 $Identifier
 $IsInformationCollector
 $IsRequired
 $IsSearchable
 $Module
 $NameList
 $Position
 $SerializedNameList
 $Version

Static Protected Member Functions

static classAttributeIdentifiersHash ()
 Returns the class attribute identifier hash for the current database.

Static Private Attributes

static $identifierHash = null
 In-memory cache for class attributes identifiers / id matching.

Detailed Description

Encapsulates data for a class attribute.

Definition at line 38 of file ezcontentclassattribute.php.


Member Function Documentation

eZContentClassAttribute::__clone ( )

Definition at line 171 of file ezcontentclassattribute.php.

static eZContentClassAttribute::cachedInfo ( ) [static]

Definition at line 531 of file ezcontentclassattribute.php.

Referenced by dataTypeByID(), and sortKeyTypeByID().

static eZContentClassAttribute::classAttributeIDByIdentifier ( identifier) [static]

Resolves the string class attribute identifier $identifier to its numeric value Use eZContentObjectTreeNode::classAttributeIDByIdentifier() for < 4.1.

If multiple classes have the same identifier, the first found is returned.

Since:
Version 4.1
Returns:
int|false Returns classattributeid or false

Definition at line 680 of file ezcontentclassattribute.php.

static eZContentClassAttribute::classAttributeIdentifierByID ( id) [static]

Resolves the numeric class attribute identifier $id to its string value.

Since:
Version 4.1
Returns:
string|false Returns classattributeidentifier or false

Definition at line 697 of file ezcontentclassattribute.php.

Referenced by eZContentObjectAttribute\contentClassAttributeIdentifier().

static eZContentClassAttribute::classAttributeIdentifiersHash ( ) [static, protected]

Returns the class attribute identifier hash for the current database.

If it is outdated or non-existent, the method updates/generates the file

Since:
Version 4.1 protected
Returns:
array Returns hash of classattributeidentifier => classattributeid

Definition at line 719 of file ezcontentclassattribute.php.

Referenced by classAttributeIDByIdentifier().

eZContentClassAttribute::content ( )
Returns:
The content for this attribute.

Definition at line 474 of file ezcontentclassattribute.php.

static eZContentClassAttribute::create ( class_id,
data_type_string,
optionalValues = array(),
languageLocale = false 
) [static]

Creates an 'eZContentClassAttribute' object.

To specify contentclassattribute name use either $optionalValues['serialized_name_list'] or combination of $optionalValues['name'] and/or $languageLocale.

In case of conflict(when both 'serialized_name_list' and 'name' with/without $languageLocale are specified) 'serialized_name_list' has top priority. This means that 'name' and $languageLocale will be ingnored because 'serialized_name_list' already has all needed info about names and languages.

If 'name' is specified then the contentclassattribute will have a name in $languageLocale(if specified) or in default language.

If neither of 'serialized_name_list' or 'name' isn't specified then the contentclassattribute will have an empty name in 'languageLocale'(if specified) or in default language.

Returns:
'eZContentClassAttribute' object.

Definition at line 195 of file ezcontentclassattribute.php.

Referenced by eZSiteInstaller\addClassAttributes(), cachedInfo(), dataType(), initializeObjectAttributes(), eZContentClassPackageHandler\install(), instantiate(), and instantiateTemporary().

eZContentClassAttribute::currentModule ( )
Returns:
the module which uses this attribute or null if no module set.
Note:
Currently only customHTTPAction sets this.

Definition at line 526 of file ezcontentclassattribute.php.

eZContentClassAttribute::customHTTPAction ( module,
http,
action 
)

Executes the custom HTTP action

Definition at line 513 of file ezcontentclassattribute.php.

eZContentClassAttribute::dataType ( )
static eZContentClassAttribute::dataTypeByID ( classAttributeID) [static]
static eZContentClassAttribute::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 55 of file ezcontentclassattribute.php.

Referenced by create(), fetch(), fetchFilteredList(), fetchList(), fetchListByClassID(), move(), eZContentClass\removeAttributes(), and eZContentClass\removeTemporary().

eZContentClassAttribute::diff ( old,
new 
)

This methods relay calls to the diff method inside the datatype.

Definition at line 624 of file ezcontentclassattribute.php.

eZContentClassAttribute::displayInfo ( )
Returns:
Information on how to display the class attribute. See eZDataType::classDisplayInformation() for more information on what is returned.

Definition at line 497 of file ezcontentclassattribute.php.

static eZContentClassAttribute::expireCache ( contentClassAttributeID = false,
contentClassID = false 
) [static]

Clears all content class attribute related caches.

Parameters:
int$contentClassAttributeIDSpecific attribute ID to clear cache for
int$contentClassIDSpecific attribute ID to clear cache for
Returns:
void
Since:
4.2

Definition at line 838 of file ezcontentclassattribute.php.

Referenced by removeThis(), store(), and storeDefined().

eZContentClassAttribute::eZContentClassAttribute ( row)

Definition at line 40 of file ezcontentclassattribute.php.

Referenced by create().

static eZContentClassAttribute::fetch ( id,
asObject = true,
version = eZContentClass::VERSION_STATUS_DEFINED,
field_filters = null 
) [static]
static eZContentClassAttribute::fetchFilteredList ( cond,
asObject = true 
) [static]
static eZContentClassAttribute::fetchList ( asObject = true,
parameters = array() 
) [static]
static eZContentClassAttribute::fetchListByClassID ( classID,
version = eZContentClass::VERSION_STATUS_DEFINED,
asObject = true 
) [static]
eZContentClassAttribute::initializeObjectAttributes ( &$  objects = null)

Definition at line 768 of file ezcontentclassattribute.php.

eZContentClassAttribute::instantiate ( contentobjectID,
languageCode = false,
version = 1 
)

Definition at line 226 of file ezcontentclassattribute.php.

eZContentClassAttribute::instantiateTemporary ( contentobjectID = false)

Definition at line 234 of file ezcontentclassattribute.php.

eZContentClassAttribute::move ( down,
params = null 
)

Moves the object down if $down is true, otherwise up. If object is at either top or bottom it is wrapped around.

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 445 of file ezcontentclassattribute.php.

eZContentClassAttribute::name ( languageLocale = false)

Definition at line 639 of file ezcontentclassattribute.php.

static eZContentClassAttribute::nameFromSerializedString ( serializedNameList,
languageLocale = false 
) [static]

Definition at line 634 of file ezcontentclassattribute.php.

Referenced by eZContentObjectVersion\fetchAttributes().

eZContentClassAttribute::nameList ( )

Definition at line 649 of file ezcontentclassattribute.php.

eZContentClassAttribute::removeThis ( quiet = false)
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 296 of file ezcontentclassattribute.php.

eZContentClassAttribute::removeTranslation ( languageLocale)

Definition at line 666 of file ezcontentclassattribute.php.

eZContentClassAttribute::setAlwaysAvailableLanguage ( languageLocale)

Definition at line 654 of file ezcontentclassattribute.php.

eZContentClassAttribute::setContent ( content)

Sets the content for the current attribute

Definition at line 488 of file ezcontentclassattribute.php.

eZContentClassAttribute::setName ( name,
languageLocale = false 
)

Definition at line 644 of file ezcontentclassattribute.php.

static eZContentClassAttribute::sortKeyTypeByID ( classAttributeID) [static]
eZContentClassAttribute::store ( fieldFilters = null)

Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it.

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.

Reimplemented from eZPersistentObject.

Definition at line 239 of file ezcontentclassattribute.php.

Referenced by storeDefined().

eZContentClassAttribute::storeDefined ( )
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 266 of file ezcontentclassattribute.php.


Member Data Documentation

eZContentClassAttribute::$Content

Contains the content for this attribute.

Definition at line 875 of file ezcontentclassattribute.php.

eZContentClassAttribute::$ContentClassID

Definition at line 880 of file ezcontentclassattribute.php.

eZContentClassAttribute::$DataTypeString

Definition at line 886 of file ezcontentclassattribute.php.

eZContentClassAttribute::$DisplayInfo

Contains information on how to display the current attribute in various viewmodes.

Definition at line 877 of file ezcontentclassattribute.php.

eZContentClassAttribute::$ID

Definition at line 878 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Identifier

Definition at line 881 of file ezcontentclassattribute.php.

eZContentClassAttribute::$identifierHash = null [static, private]

In-memory cache for class attributes identifiers / id matching.

Definition at line 896 of file ezcontentclassattribute.php.

Referenced by classAttributeIDByIdentifier(), classAttributeIdentifierByID(), and classAttributeIdentifiersHash().

eZContentClassAttribute::$IsInformationCollector

Definition at line 890 of file ezcontentclassattribute.php.

eZContentClassAttribute::$IsRequired

Definition at line 889 of file ezcontentclassattribute.php.

eZContentClassAttribute::$IsSearchable

Definition at line 888 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Module

Definition at line 891 of file ezcontentclassattribute.php.

eZContentClassAttribute::$NameList

Definition at line 885 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Position

Definition at line 887 of file ezcontentclassattribute.php.

eZContentClassAttribute::$SerializedNameList

Definition at line 883 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Version

Definition at line 879 of file ezcontentclassattribute.php.


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