eZPublishCommunityProject(LegacyStack)  2013.5
eZContentClassAttribute Class Reference

Encapsulates data for a class attribute. More...

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

Public Member Functions

 __clone ()
 
 content ()
 
 currentModule ()
 
 customHTTPAction ($module, $http, $action)
 
 dataTextI18n ($languageLocale=false)
 Returns data_text_i18n of attribute based on serialized_data_text. More...
 
 dataTextI18nList ()
 Returns data_text_i18n list for all locales for attribute. More...
 
 dataType ()
 
 description ($languageLocale=false)
 Returns description of attribute based on serialized_description_list. More...
 
 descriptionList ()
 Returns description list for all locales for attribute. More...
 
 diff ($old, $new)
 
 displayInfo ()
 
 editLocale ()
 Returns locale code as set with self::setEditLocale(). More...
 
 eZContentClassAttribute ($row)
 
 initializeObjectAttributes (&$objects=null)
 Initialize the attribute in the existing objects. More...
 
 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. More...
 
 nameList ()
 Returns name list for all locales for attribute. More...
 
 removeThis ($quiet=false)
 
 removeTranslation ($languageLocale)
 Removes an translation (as in the serilized strings for name, description or data_text_i18n) More...
 
 setAlwaysAvailableLanguage ($languageLocale)
 Specify AlwaysAvailableLanguage (for name, description or data_text_i18n) More...
 
 setContent ($content)
 
 setDataTextI18n ($string, $languageLocale=false)
 Sets data_text_i18n of attribute, store() will take care of writing back to serialized_data_text. More...
 
 setDescription ($description, $languageLocale=false)
 Sets description of attribute, store() will take care of writing back to serialized_description_list. More...
 
 setEditLocale ($languageLocale=false)
 Sets locale code of attribute for use by datatypes in class/edit storing process. More...
 
 setName ($name, $languageLocale=false)
 Sets name of attribute, store() will take care of writing back to serialized_name_list. More...
 
 store ($fieldFilters=null)
 
 storeDefined ()
 Store the content class in the version status "defined". More...
 
 storeVersioned ($version)
 Store the content class in the specified version status. More...
 
- Public Member Functions inherited from eZPersistentObject
 attribute ($attr, $noFunction=false)
 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. More...
 
 attributes ()
 Returns the attributes for this object, taken from the definition fields and function attributes. More...
 
 eZPersistentObject ($row)
 Initializes the object with the $row. More...
 
 fill ($row)
 Tries to fill in the data in the object by using the object definition which is returned by the function definition() and the database row data $row. More...
 
 hasAttribute ($attr)
 Checks if $attr is part of the definition fields or function attributes. More...
 
 hasDirtyData ()
 Returns true if the data is considered dirty and needs to be stored. More...
 
 remove ($conditions=null, $extraConditions=null)
 Removes the object from the database, it will use the keys in the object definition to figure out which table row should be removed unless $conditions is defined as an array with fieldnames. More...
 
 setAttribute ($attr, $val)
 Sets the attribute $attr to the value $val. More...
 
 setHasDirtyData ($hasDirtyData)
 Sets whether the object has dirty data or not. More...
 
 store ($fieldFilters=null)
 Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it. More...
 
 sync ($fieldFilters=null)
 Makes sure data is stored if the data is considered dirty. More...
 

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. More...
 
static classAttributeIdentifierByID ($id)
 Resolves the numeric class attribute identifier $id to its string value. More...
 
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. More...
 
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. More...
 
static sortKeyTypeByID ($classAttributeID)
 
- Static Public Member Functions inherited from eZPersistentObject
static conditionText ($conditions)
 Calls conditionTextByRow with an empty row and $conditions. More...
 
static conditionTextByRow ($conditions, $row)
 Generates an SQL sentence from the conditions $conditions and row data $row. More...
 
static count ($def, $conds=null, $field=null)
 Fetches the number of rows by using the object definition. More...
 
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array. More...
 
static escapeArray ($array)
 Escapes strings in an array with the help of eZDBInterface::escapeString(). More...
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 Fetches and returns an object based on the given parameters and returns is either as an object or as an array. More...
 
static fetchObjectList ($def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
 Creates an SQL query out of the different parameters and returns an array with the result. More...
 
static getShortAttributeName ($db, $def, $attrName)
 Returns the short attribute name (alias) if it's defined, given attribute name otherwise. More...
 
static handleRows ($rows, $class_name, $asObject)
 Creates PHP objects out of the database rows $rows. More...
 
static newObjectOrder ($def, $orderField, $conditions)
 Returns an order value which can be used for new items in table, for instance placement. More...
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 Deletes the object from the table defined in $def with conditions $conditions and extra conditions $extraConditions. More...
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 Moves a row in a database table. More...
 
static replaceFieldsWithShortNames ($db, $fieldDefs, &$fields)
 For the given array $fields treats its keys (for associative array) or values (for non-associative array) as table fields names and replaces them with short names (aliases) found in $fieldDefs. More...
 
static storeObject ($obj, $fieldFilters=null)
 Stores the data in $obj to database. More...
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 Sets row id $id2 to have the placement of row id $id1. More...
 
static updateObjectList ($parameters)
 Updates rows matching the given parameters. More...
 

Public Attributes

 $Content
 Contains the content for this attribute. More...
 
 $ContentClassID
 
 $DataTypeString
 
 $DescriptionList
 
 $DisplayInfo
 Contains information on how to display the current attribute in various viewmodes. More...
 
 $ID
 
 $Identifier
 
 $IsInformationCollector
 
 $IsRequired
 
 $IsSearchable
 
 $Module
 
 $NameList
 
 $Position
 
 $SerializedNameList
 
 $Version
 
- Public Attributes inherited from eZPersistentObject
 $PersistentDataDirty
 

Static Protected Member Functions

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

Protected Attributes

 $EditLocale = false
 

Static Private Attributes

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

Detailed Description

Encapsulates data for a class attribute.

Member Function Documentation

eZContentClassAttribute::__clone ( )
static eZContentClassAttribute::cachedInfo ( )
static

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

Referenced by eZContentObjectTreeNode\classAttributeIDByIdentifier().

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

Referenced by eZContentObjectAttribute\contentClassAttributeIdentifier().

static eZContentClassAttribute::classAttributeIdentifiersHash ( )
staticprotected

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
eZContentClassAttribute::content ( )
Returns
The content for this attribute.
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.

Referenced by eZSiteInstaller\addClassAttributes(), and eZContentClassPackageHandler\install().

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

Executes the custom HTTP action

eZContentClassAttribute::dataTextI18n (   $languageLocale = false)

Returns data_text_i18n of attribute based on serialized_data_text.

Parameters
string | false$languageLocaleUses AlwaysAvailable language if false
Returns
string
eZContentClassAttribute::dataTextI18nList ( )

Returns data_text_i18n list for all locales for attribute.

Returns
array
eZContentClassAttribute::dataType ( )
static eZContentClassAttribute::dataTypeByID (   $classAttributeID)
static
eZContentClassAttribute::description (   $languageLocale = false)

Returns description of attribute based on serialized_description_list.

Parameters
string | false$languageLocaleUses AlwaysAvailable language if false
Returns
string
eZContentClassAttribute::descriptionList ( )

Returns description list for all locales for attribute.

Returns
array
eZContentClassAttribute::diff (   $old,
  $new 
)

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

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

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

Returns
string|false
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

Referenced by eZContentClass\expireCache().

eZContentClassAttribute::eZContentClassAttribute (   $row)

Referenced by create().

static eZContentClassAttribute::fetchList (   $asObject = true,
  $parameters = array() 
)
static
static eZContentClassAttribute::fetchListByClassID (   $classID,
  $version = eZContentClass::VERSION_STATUS_DEFINED,
  $asObject = true 
)
static
eZContentClassAttribute::initializeObjectAttributes ( $objects = null)

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).
eZContentClassAttribute::instantiate (   $contentobjectID,
  $languageCode = false,
  $version = 1 
)
eZContentClassAttribute::instantiateTemporary (   $contentobjectID = false)
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.
eZContentClassAttribute::name (   $languageLocale = false)

Returns name of attribute based on serialized_name_list.

Parameters
string | false$languageLocaleUses AlwaysAvailable language if false
Returns
string
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

Referenced by eZContentObjectVersion\fetchAttributes().

eZContentClassAttribute::nameList ( )

Returns name list for all locales for attribute.

Returns
array
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.
eZContentClassAttribute::removeTranslation (   $languageLocale)

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

Parameters
string$languageLocale
eZContentClassAttribute::setAlwaysAvailableLanguage (   $languageLocale)

Specify AlwaysAvailableLanguage (for name, description or data_text_i18n)

Parameters
string | false$languageLocale
eZContentClassAttribute::setContent (   $content)

Sets the content for the current attribute

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
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
eZContentClassAttribute::setEditLocale (   $languageLocale = false)

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

Parameters
string | false$languageLocaleUses AlwaysAvailable language if false
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
static eZContentClassAttribute::sortKeyTypeByID (   $classAttributeID)
static
eZContentClassAttribute::store (   $fieldFilters = null)
eZContentClassAttribute::storeDefined ( )

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
eZContentClassAttribute::storeVersioned (   $version)

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

Referenced by storeDefined().

Member Data Documentation

eZContentClassAttribute::$Content

Contains the content for this attribute.

Referenced by content().

eZContentClassAttribute::$ContentClassID

Referenced by initializeObjectAttributes(), and move().

eZContentClassAttribute::$DataTypeString
eZContentClassAttribute::$DescriptionList
eZContentClassAttribute::$DisplayInfo

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

Referenced by displayInfo().

eZContentClassAttribute::$EditLocale = false
protected

Referenced by editLocale().

eZContentClassAttribute::$ID
eZContentClassAttribute::$Identifier
eZContentClassAttribute::$identifierHash = null
staticprivate

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

Referenced by classAttributeIDByIdentifier(), and classAttributeIdentifierByID().

eZContentClassAttribute::$IsInformationCollector
eZContentClassAttribute::$IsRequired
eZContentClassAttribute::$IsSearchable
eZContentClassAttribute::$Module

Referenced by currentModule().

eZContentClassAttribute::$NameList
eZContentClassAttribute::$Position

Referenced by move().

eZContentClassAttribute::$SerializedNameList
eZContentClassAttribute::$Version

Referenced by move().


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