eZ Publish  [trunk]
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)
 dataTextI18n ($languageLocale=false)
 Returns data_text_i18n of attribute based on serialized_data_text.
 dataTextI18nList ()
 Returns data_text_i18n list for all locales for attribute.
 dataType ()
 description ($languageLocale=false)
 Returns description of attribute based on serialized_description_list.
 descriptionList ()
 Returns description list for all locales for attribute.
 diff ($old, $new)
 displayInfo ()
 editLocale ()
 Returns locale code as set with self::setEditLocale().
 eZContentClassAttribute ($row)
 initializeObjectAttributes (&$objects=null)
 Initialize the attribute in the existing objects.
 instantiate ($contentobjectID, $languageCode=false, $version=1)
 instantiateTemporary ($contentobjectID=false)
 move ($down, $params=null)
 name ($languageLocale=false)
 Returns name of attribute based on serialized_name_list.
 nameList ()
 Returns name list for all locales for attribute.
 removeThis ($quiet=false)
 removeTranslation ($languageLocale)
 Removes an translation (as in the serilized strings for name, description or data_text_i18n)
 setAlwaysAvailableLanguage ($languageLocale)
 Specify AlwaysAvailableLanguage (for name, description or data_text_i18n)
 setContent ($content)
 setDataTextI18n ($string, $languageLocale=false)
 Sets data_text_i18n of attribute, store() will take care of writing back to serialized_data_text.
 setDescription ($description, $languageLocale=false)
 Sets description of attribute, store() will take care of writing back to serialized_description_list.
 setEditLocale ($languageLocale=false)
 Sets locale code of attribute for use by datatypes in class/edit storing process.
 setName ($name, $languageLocale=false)
 Sets name of attribute, store() will take care of writing back to serialized_name_list.
 store ($fieldFilters=null)
 Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it.
 storeDefined ()
 Store the content class in the version status "defined".
 storeVersioned ($version)
 Store the content class in the specified version status.

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 ()
 Returns the definition for the object, the default implementation is to return an empty array.
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)
 Returns name from serialized string, can be used for serialized description and data_text as well.
static sortKeyTypeByID ($classAttributeID)

Public Attributes

 $Content
 Contains the content for this attribute.
 $ContentClassID
 $DataTypeString
 $DescriptionList
 $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.

Protected Attributes

 $EditLocale = false

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


Member Function Documentation

Definition at line 590 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 863 of file ezcontentclassattribute.php.

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

Referenced by eZContentObjectAttribute\contentClassAttributeIdentifier().

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

Referenced by classAttributeIDByIdentifier().

Returns:
The content for this attribute.

Definition at line 533 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 220 of file ezcontentclassattribute.php.

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

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

Definition at line 585 of file ezcontentclassattribute.php.

eZContentClassAttribute::customHTTPAction ( module,
http,
action 
)

Executes the custom HTTP action

Definition at line 572 of file ezcontentclassattribute.php.

Returns data_text_i18n of attribute based on serialized_data_text.

Parameters:
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string

Definition at line 774 of file ezcontentclassattribute.php.

Returns data_text_i18n list for all locales for attribute.

Returns:
array

Definition at line 796 of file ezcontentclassattribute.php.

static eZContentClassAttribute::dataTypeByID ( classAttributeID) [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: public 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" ); }

Returns:
array

Reimplemented from eZPersistentObject.

Definition at line 62 of file ezcontentclassattribute.php.

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

Returns description of attribute based on serialized_description_list.

Parameters:
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string

Definition at line 741 of file ezcontentclassattribute.php.

Returns description list for all locales for attribute.

Returns:
array

Definition at line 763 of file ezcontentclassattribute.php.

eZContentClassAttribute::diff ( old,
new 
)

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

Definition at line 683 of file ezcontentclassattribute.php.

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

Definition at line 556 of file ezcontentclassattribute.php.

Returns locale code as set with self::setEditLocale().

Returns:
string|false

Definition at line 806 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 1083 of file ezcontentclassattribute.php.

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

Definition at line 20 of file ezcontentclassattribute.php.

Referenced by create().

static eZContentClassAttribute::fetchList ( asObject = true,
parameters = array() 
) [static]

Initialize the attribute in the existing objects.

Parameters:
mixed$objectsnot used, the existing objects are fetched if necessary (depending on the datatype of the attribute).

Definition at line 957 of file ezcontentclassattribute.php.

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

Definition at line 266 of file ezcontentclassattribute.php.

Definition at line 274 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 504 of file ezcontentclassattribute.php.

eZContentClassAttribute::name ( languageLocale = false)

Returns name of attribute based on serialized_name_list.

Parameters:
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string

Definition at line 708 of file ezcontentclassattribute.php.

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

Returns name from serialized string, can be used for serialized description and data_text as well.

Parameters:
string$serializedNameList
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string

Definition at line 697 of file ezcontentclassattribute.php.

Referenced by eZContentObjectVersion\fetchAttributes().

Returns name list for all locales for attribute.

Returns:
array

Definition at line 730 of file ezcontentclassattribute.php.

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

Removes an translation (as in the serilized strings for name, description or data_text_i18n)

Parameters:
string$languageLocale

Definition at line 847 of file ezcontentclassattribute.php.

Specify AlwaysAvailableLanguage (for name, description or data_text_i18n)

Parameters:
string | false$languageLocale

Definition at line 826 of file ezcontentclassattribute.php.

Sets the content for the current attribute

Definition at line 547 of file ezcontentclassattribute.php.

eZContentClassAttribute::setDataTextI18n ( string,
languageLocale = false 
)

Sets data_text_i18n of attribute, store() will take care of writing back to serialized_data_text.

Parameters:
string$string
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string Return old value

Definition at line 786 of file ezcontentclassattribute.php.

eZContentClassAttribute::setDescription ( description,
languageLocale = false 
)

Sets description of attribute, store() will take care of writing back to serialized_description_list.

Parameters:
string$description
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string Return old value

Definition at line 753 of file ezcontentclassattribute.php.

Sets locale code of attribute for use by datatypes in class/edit storing process.

Parameters:
string | false$languageLocaleUses AlwaysAvailable language if false

Definition at line 816 of file ezcontentclassattribute.php.

eZContentClassAttribute::setName ( name,
languageLocale = false 
)

Sets name of attribute, store() will take care of writing back to serialized_name_list.

Parameters:
string$name
string | false$languageLocaleUses AlwaysAvailable language if false
Returns:
string Return old value

Definition at line 720 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.

Parameters:
array | null$fieldFilters
Returns:
void

Reimplemented from eZPersistentObject.

Definition at line 279 of file ezcontentclassattribute.php.

Referenced by storeVersioned().

Store the content class in the version status "defined".

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.
Returns:
null|false false if the operation failed

Definition at line 311 of file ezcontentclassattribute.php.

Store the content class in the specified version status.

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.
Parameters:
int$versionversion status
Since:
Version 4.3
Returns:
null|false false if the operation failed

Definition at line 326 of file ezcontentclassattribute.php.

Referenced by storeDefined().


Member Data Documentation

eZContentClassAttribute::$Content

Contains the content for this attribute.

Definition at line 1120 of file ezcontentclassattribute.php.

eZContentClassAttribute::$ContentClassID

Definition at line 1125 of file ezcontentclassattribute.php.

eZContentClassAttribute::$DataTypeString

Definition at line 1133 of file ezcontentclassattribute.php.

eZContentClassAttribute::$DescriptionList

Definition at line 1132 of file ezcontentclassattribute.php.

eZContentClassAttribute::$DisplayInfo

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

Definition at line 1122 of file ezcontentclassattribute.php.

eZContentClassAttribute::$EditLocale = false [protected]

Definition at line 1140 of file ezcontentclassattribute.php.

eZContentClassAttribute::$ID

Definition at line 1123 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Identifier

Definition at line 1126 of file ezcontentclassattribute.php.

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

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

Definition at line 1145 of file ezcontentclassattribute.php.

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

eZContentClassAttribute::$IsInformationCollector

Definition at line 1137 of file ezcontentclassattribute.php.

eZContentClassAttribute::$IsRequired

Definition at line 1136 of file ezcontentclassattribute.php.

eZContentClassAttribute::$IsSearchable

Definition at line 1135 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Module

Definition at line 1138 of file ezcontentclassattribute.php.

eZContentClassAttribute::$NameList

Definition at line 1130 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Position

Definition at line 1134 of file ezcontentclassattribute.php.

eZContentClassAttribute::$SerializedNameList

Definition at line 1128 of file ezcontentclassattribute.php.

eZContentClassAttribute::$Version

Definition at line 1124 of file ezcontentclassattribute.php.


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