Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Private Attributes | List of all members
eZContentClass Class Reference

Handles eZ Publish content classes. More...

Inheritance diagram for eZContentClass:

## Public Member Functions
| __construct ( $row)
| __clone ()
| instantiateIn ( $lang, $userID=false, $sectionID=0, $versionNumber=false, $versionStatus=eZContentObjectVersion::STATUS_INTERNAL_DRAFT)
| instantiate ( $userID=false, $sectionID=0, $versionNumber=false, $languageCode=false, $versionStatus=eZContentObjectVersion::STATUS_INTERNAL_DRAFT)
| canInstantiateClasses ()
| creator ()
| modifier ()
| fetchGroupList ()
| fetchGroupIDList ()
| fetchMatchGroupIDList ()
| fetchAllGroups ()
| inGroup ( $groupID)
| remoteID ()
| remove ( $removeAttributes=false, $version=eZContentClass::VERSION_STATUS_DEFINED)
| isRemovable ()
| removableInformation ( $includeAll=true)
| removeAttributes ( $removeAttributes=false, $version=false)
| compareAttributes ( $attr1, $attr2)
| adjustAttributePlacements ( $attributes)
| store ( $store_childs=false, $fieldFilters=null)
| sync ( $fieldFilters=null)
| initializeCopy (&$originalClass)
| storeDefined ( $attributes)
| storeVersioned ( $attributes, $version)
| setVersion ( $version, $set_childs=false)
| dataMap ()
| fetchAttributes ( $id=false, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED)
| fetchAttributeByIdentifier ( $identifier, $asObject=true)
| fetchSearchableAttributes ( $id=false, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED)
| versionStatus ()
| versionCount ()
| contentObjectName (eZContentObject $contentObject, $version=false, $translation=false)
| urlAliasName (eZContentObject $contentObject, $version=false, $translation=false)
| buildContentObjectName ( $contentObjectName, $dataMap, $tmpTags=false)
| objectCount ()
| objectList ()
| setCanInstantiateLanguages ( $languageCodes)
| canInstantiateLanguages ()
| hasNameInLanguage ( $languageLocale)
| name ( $languageLocale=false)
| setName ( $name, $languageLocale=false)
| nameList ()
| description ( $languageLocale=false)
| setDescription ( $description, $languageLocale=false)
| descriptionList ()
| setAlwaysAvailableLanguageID ( $languageID, $updateChilds=true)
| clearAlwaysAvailableLanguageID ()
| languages ()
| prioritizedLanguages ()
| prioritizedLanguagesJsArray ()
| canCreateLanguages ()
| topPriorityLanguageLocale ()
| alwaysAvailableLanguage ()
| alwaysAvailableLanguageLocale ()
| removeTranslation ( $languageID)
Public Member Functions inherited from eZPersistentObject
| eZPersistentObject ( $row=null)
| fill ( $row)
| store ( $fieldFilters=null)
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr, $noFunction=false)
| setAttribute ( $attr, $val)
| hasDirtyData ()
| setHasDirtyData ( $hasDirtyData)

## Static Public Member Functions
static | definition ()
static | create ( $userID=false, $optionalValues=array(), $languageLocale=false)
static | canInstantiateClassList ( $asObject=false, $includeFilter=true, $groupList=false, $fetchID=false)
static | fetchAllClasses ( $asObject=true, $includeFilter=true, $groupList=false)
static | removeTemporary ()
static | exists ( $id, $version=eZContentClass::VERSION_STATUS_DEFINED, $userID=false, $useIdentifier=false)
static | fetch ( $id, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $user_id=false, $parent_id=null)
static | fetchByRemoteID ( $remoteID, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $user_id=false, $parent_id=null)
static | fetchByIdentifier ( $identifier, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $user_id=false, $parent_id=null)
static | fetchList ( $version=eZContentClass::VERSION_STATUS_DEFINED, $asObject=true, $user_id=false, $sorts=null, $fields=null, $classFilter=false, $limit=null)
static | nameFromSerializedString ( $serializedNameList)
static | descriptionFromSerializedString ( $serializedNameList)
static | classIDByIdentifier ( $identifier)
static | classIdentifierByID ( $id)
static | fetchIDListContainingDatatype ( $dataTypeString)
static | expireCache ()
static | versionHistoryLimit ( $class)
Static Public Member Functions inherited from eZPersistentObject
static | replaceFieldsWithShortNames (eZDBInterface $db, array $fieldDefs, &$fields)
static | count ( $def, $conds=null, $field=null)
static | fetchObject ( $def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
static | removeObject ( $def, $conditions=null, $extraConditions=null)
static | storeObject ( $obj, $fieldFilters=null)
static | conditionText ( $conditions)
static | conditionTextByRow ( $conditions, $row)
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)
static | handleRows ( $rows, $class_name, $asObject)
static | swapRow ( $table, $keys, $order_id, $rows, $id1, $id2)
static | newObjectOrder ( $def, $orderField, $conditions)
static | reorderObject ( $def, $orderField, $conditions, $down=true)
static | escapeArray ( $array)
static | updateObjectList ( $parameters)
static | getShortAttributeName ( $db, $def, $attrName)

## Public Attributes
| $InGroupIDs
const | VERSION_STATUS_DEFINED = 0
const | VERSION_STATUS_TEMPORARY = 1
const | VERSION_STATUS_MODIFIED = 2
const | CONTENT_OBJECT_NAME_MAX_LENGTH = 255
| $ID
| $SerializedNameList
| $NameList
| $DescriptionList
| $Identifier
| $ContentObjectName
| $Version
| $VersionCount
| $CreatorID
| $ModifierID
| $Created
| $Modified
| $InGroups
| $AllGroups
| $IsContainer
| $CanInstantiateLanguages
| $LanguageMask
| $DataMap
Public Attributes inherited from eZPersistentObject
| $PersistentDataDirty
| $ID
| $ContentObjectID
| $SectionID
| $OwnerID
| $ClassID
| $Published
| $Modified
| $CurrentVersion
| $Status
| $RemoteID
| $LanguageMask
| $InitialLanguageID
| $NodeID
| $ParentNodeID
| $MainNodeID
| $ContentObjectVersion
| $ContentObjectIsPublished
| $Depth
| $SortField
| $SortOrder
| $Priority
| $ModifiedSubNode
| $PathString
| $PathIdentificationString
| $IsHidden
| $IsInvisible
| $UserID
| $Name
| $Locale
| $Identifier
| $NavigationPartIdentifier
| $SerializedDescriptionList
| $URLAliasName
| $AlwaysAvailable
| $CanTranslate
| $DataInt1
| $DataInt2
| $DataInt3
| $DataInt4
| $DataFloat1
| $DataFloat2
| $DataFloat3
| $DataFloat4
| $DataText1
| $DataText2
| $DataText3
| $DataText4
| $DataText5
| $SerializedDataText
| $Category
| $PolicyID
| $Values
| $Created
| $CurrencyCode
| $ProductCollectionID
| $ItemCount
| $Price
| $IsVATIncluded
| $VATValue
| $DiscountValue
| $Email
| $IsTemporary
| $IsArchived
| $IsActive
| $OrderID
| $ModifierID
| $Code
| $Symbol
| $AutoRateValue
| $CustomRateValue
| $RateFactor
| $Main
| $MementoKey
| $MainKey
| $WorkflowEventPos
| $LanguageID
| $ContentObjectStateGroupID
| $contentobject_attribute_id
| $contentobject_id
| $rating
| $rating_count
| $rating_average

## Static Protected Member Functions
static | classIdentifiersHash ()
Static Protected Member Functions inherited from eZPersistentObject
static | replaceFieldsWithLongNames (eZDBInterface $db, array $fieldDefs, &$fields)

## Static Private Attributes
static | $identifierHash = null

## Detailed Description

Handles eZ Publish content classes.

See also
  eZContentObject

Definition at line 19 of file ezcontentclass.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZContentClass::__construct | ( |  | $row | ) |

Initializes the object with the $row.

It will try to set each field taken from the database row. Calls fill to do the job. If $row is an integer, it will try to fetch it from the database using it as the unique ID.

Parameters

  int | array | $row |

Reimplemented from eZPersistentObject.

Definition at line 32 of file ezcontentclass.php.

## Member Function Documentation

## ◆ __clone()

eZContentClass::__clone | ( |  | ) |

Definition at line 174 of file ezcontentclass.php.

References eZRemoteIdUtility\generate().

## ◆ adjustAttributePlacements()

eZContentClass::adjustAttributePlacements | ( |  | $attributes | ) |

Definition at line 893 of file ezcontentclass.php.

Referenced by storeVersioned().

## ◆ alwaysAvailableLanguage()

eZContentClass::alwaysAvailableLanguage | ( |  | ) |

Wrapper for eZContentClassNameList::alwaysAvailableLanguage.

Returns
  'language' object.

Definition at line 1710 of file ezcontentclass.php.

## ◆ alwaysAvailableLanguageLocale()

eZContentClass::alwaysAvailableLanguageLocale | ( |  | ) |

Wrapper for eZContentClassNameList::alwaysAvailableLanguageLocale.

Returns
  'language' object.

Definition at line 1720 of file ezcontentclass.php.

## ◆ buildContentObjectName()

eZContentClass::buildContentObjectName | ( |  | $contentObjectName,
|  |  | $dataMap,
|  |  | $tmpTags = `false`
| ) |  |

Generates a name for the content object based on the content object name pattern and data map of an object.

Definition at line 1445 of file ezcontentclass.php.

## ◆ canCreateLanguages()

eZContentClass::canCreateLanguages | ( |  | ) |

Wrapper for eZContentClassNameList::untranslatedLanguages.

Definition at line 1692 of file ezcontentclass.php.

## ◆ canInstantiateClasses()

eZContentClass::canInstantiateClasses | ( |  | ) |

Definition at line 349 of file ezcontentclass.php.

References eZUser\currentUser().

## ◆ canInstantiateClassList()

static eZContentClass::canInstantiateClassList | ( |  | $asObject = `false`,
|  |  | $includeFilter = `true`,
|  |  | $groupList = `false`,
|  |  | $fetchID = `false`
| ) |  |
| static

Finds all classes that the current user can create objects from and returns. It is also possible to filter the list event more with $includeFilter and $groupList.

Parameters

  $asObject | If `true` then it return eZContentClass objects, if not it will be an associative array with `name` and `id` keys.
  $includeFilter | If `true` then it will include only from class groups defined in $groupList, if not it will exclude those groups.
  $groupList | An array with class group IDs that should be used in filtering, use `false` if you do not wish to filter at all.
  $fetchID | A unique name for the current fetch, this must be supplied when filtering is used if you want caching to work.

Definition at line 379 of file ezcontentclass.php.

References eZPersistentObject\count(), eZUser\currentUser(), eZContentLanguage\fetchLocaleList(), eZPersistentObject\handleRows(), eZDB\instance(), eZHTTPTool\instance(), eZContentClassName\sqlFilter(), VERSION_STATUS_DEFINED, and eZDebugSetting\writeDebug().

Referenced by eZContentObjectTreeNode\getClassesJsArray().

## ◆ canInstantiateLanguages()

eZContentClass::canInstantiateLanguages | ( |  | ) |

Definition at line 1512 of file ezcontentclass.php.

References eZContentLanguage\prioritizedLanguageCodes().

## ◆ classIDByIdentifier()

static eZContentClass::classIDByIdentifier | ( |  | $identifier | ) |
| static

Resolves the string class identifier $identifier to its numeric value Use eZContentObjectTreeNode::classIDByIdentifier() for < 4.1. If multiple classes have the same identifier, the first found is returned.

Since
  Version 4.1

Parameters

  string | array | $identifier | identifier string or array of identifiers (array support added in 4.1.1)

Returns
  int|false Returns classid or false

Definition at line 1790 of file ezcontentclass.php.

References $identifierHash, and classIdentifiersHash().

Referenced by eZContentObjectTreeNode\classIDByIdentifier(), eZContentObjectTreeNode\createClassFilteringSQLString(), eZContentObjectTreeNode\subTreeCountByNodeID(), and versionHistoryLimit().

## ◆ classIdentifierByID()

static eZContentClass::classIdentifierByID | ( |  | $id | ) |
| static

Resolves the numeric class identifier $id to its string value

Since
  Version 4.1

Returns
  string|false Returns classidentifier or false

Definition at line 1819 of file ezcontentclass.php.

References $identifierHash.

Referenced by eZContentObject\contentClassIdentifier(), and versionHistoryLimit().

## ◆ classIdentifiersHash()

static eZContentClass::classIdentifiersHash | ( |  | ) |
| static protected

Returns the class identifier hash for the current database. If it is outdated or non-existent, the method updates/generates the file

Since
  Version 4.1 @access protected

Returns
  array Returns hash of classidentifier => classid

Definition at line 1838 of file ezcontentclass.php.

References $identifierHash, eZSys\cacheDirectory(), and eZDB\instance().

Referenced by classIDByIdentifier().

## ◆ clearAlwaysAvailableLanguageID()

eZContentClass::clearAlwaysAvailableLanguageID | ( |  | ) |

Definition at line 1663 of file ezcontentclass.php.

References setAlwaysAvailableLanguageID().

## ◆ compareAttributes()

eZContentClass::compareAttributes | ( |  | $attr1,
|  |  | $attr2
| ) |  |

Definition at line 888 of file ezcontentclass.php.

## ◆ contentObjectName()

eZContentClass::contentObjectName | ( | eZContentObject | $contentObject,
|  |  | $version = `false`,
|  |  | $translation = `false`
| ) |  |

Will generate a name for the content object based on the class settings for content object limited by self::CONTENT_OBJECT_NAME_MAX_LENGTH.

Parameters

  eZContentObject | $contentObject |
  int | false | $version |
  string | false | $translation |

Returns
  string

Definition at line 1397 of file ezcontentclass.php.

References $ContentObjectName, and CONTENT_OBJECT_NAME_MAX_LENGTH.

## ◆ create()

static eZContentClass::create | ( |  | $userID = `false`,
|  |  | $optionalValues = `array()`,
|  |  | $languageLocale = `false`
| ) |  |
| static

Creates an 'eZContentClass' object.

To specify contentclass 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 contentclass 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 contentclass will have an empty name in 'languageLocale'(if specified) or in default language.

'language_mask' and 'initial_language_id' attributes will be set according to specified(either in 'serialized_name_list' or by $languageLocale) languages.

Returns
  'eZContentClass' object.

Definition at line 207 of file ezcontentclass.php.

References eZUser\currentUserID(), definition(), and eZRemoteIdUtility\generate().

Referenced by eZContentClassPackageHandler\install().

## ◆ creator()

eZContentClass::creator | ( |  | ) |

Returns
  The creator of the class as an eZUser object by using the $CreatorID as user ID.

Definition at line 588 of file ezcontentclass.php.

References eZUser\fetch().

## ◆ dataMap()

eZContentClass::dataMap | ( |  | ) |

Returns all attributes as an associative array with the key taken from the attribute identifier.

Definition at line 1307 of file ezcontentclass.php.

References $Version, and fetchAttributes().

## ◆ definition()

static eZContentClass::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: `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 58 of file ezcontentclass.php.

Referenced by create(), exists(), fetch(), fetchByIdentifier(), fetchByRemoteID(), and fetchList().

## ◆ description()

eZContentClass::description | ( |  | $languageLocale = `false` | ) |

Returns a contentclass description in $languageLocale language. Uses siteaccess language list or 'always available' language if $languageLocale is 'false'.

Returns
  string with contentclass name.

Definition at line 1586 of file ezcontentclass.php.

## ◆ descriptionFromSerializedString()

static eZContentClass::descriptionFromSerializedString | ( |  | $serializedNameList | ) |
| static

Returns a contentclass description from serialized array $serializedNameList using top language from siteaccess language list or 'always available' name from $serializedNameList.

Returns
  string with contentclass description.

Definition at line 1542 of file ezcontentclass.php.

References eZSerializedObjectNameList\nameFromSerializedString().

## ◆ descriptionList()

eZContentClass::descriptionList | ( |  | ) |

Definition at line 1596 of file ezcontentclass.php.

## ◆ exists()

static eZContentClass::exists | ( |  | $id,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`,
|  |  | $userID = `false`,
|  |  | $useIdentifier = `false`
| ) |  |
| static

Definition at line 1092 of file ezcontentclass.php.

References eZPersistentObject\count(), definition(), eZPersistentObject\fetchObjectList(), and VERSION_STATUS_DEFINED.

Referenced by eZContentClassPackageHandler\handleParameters().

## ◆ expireCache()

static eZContentClass::expireCache | ( |  | ) |
| static

Expires in-memory cache for eZContentClass.

Clears cache for fetched eZContentClass objects, class identifiers and class attributes.

Since
  4.2

Definition at line 1912 of file ezcontentclass.php.

References eZContentClassAttribute\expireCache().

Referenced by eZCache\clearClassID(), and store().

## ◆ fetch()

static eZContentClass::fetch | ( |  | $id,
|  |  | $asObject = `true`,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`,
|  |  | $user_id = `false`,
|  |  | $parent_id = `null`
| ) |  |
| static

Definition at line 1116 of file ezcontentclass.php.

References eZPersistentObject\count(), definition(), eZPersistentObject\fetchObjectList(), and VERSION_STATUS_DEFINED.

Referenced by eZISBN10To13Converter\addClass(), eZContentClassPackageHandler\addClass(), eZSiteInstaller\addClassAttributes(), eZRSSExportItem\classAttributes(), eZRSSImport\classAttributes(), eZWaitUntilDateValue\className(), eZContentObject\contentClass(), eZObjectRelationListType\createNewObject(), eZContentObject\createWithNodeAssignment(), eZObjectRelationListType\customObjectAttributeHTTPAction(), eZISBN10To13Converter\execute(), eZTemplateOptimizer\fetchClassDeclaration(), eZContentClassClassGroup\fetchClassListByGroups(), eZContentObjectPackageHandler\generateFetchAliasArray(), eZContentClassPackageCreator\generatePackageInformation(), eZContentClassPackageHandler\handleParameters(), eZTextFileUser\loginUser(), eZLDAPUser\publishNewUserGroup(), eZLDAPUser\publishUpdateUser(), and eZContentClassOperations\remove().

## ◆ fetchAllClasses()

static eZContentClass::fetchAllClasses | ( |  | $asObject = `true`,
|  |  | $includeFilter = `true`,
|  |  | $groupList = `false`
| ) |  |
| static

Finds all Classes in the system and returns them.

Returns
  An array with eZContentClass objects.

Definition at line 662 of file ezcontentclass.php.

References eZPersistentObject\handleRows(), eZDB\instance(), eZContentClassName\sqlFilter(), and VERSION_STATUS_DEFINED.

Referenced by eZContentObjectTreeNode\availableClassListJsArray().

## ◆ fetchAllGroups()

eZContentClass::fetchAllGroups | ( |  | ) |

Finds all Class groups in the system and returns them.

Returns
  An array with eZContentClassGroup objects.

See also
  fetchGroupList(), fetchGroupIDList()

Definition at line 699 of file ezcontentclass.php.

References $AllGroups, and eZContentClassGroup\fetchList().

## ◆ fetchAttributeByIdentifier()

eZContentClass::fetchAttributeByIdentifier | ( |  | $identifier,
|  |  | $asObject = `true`
| ) |  |

Fetch class attribute by identifier, return null if none exist.

Parameters

  attribute | identifier.

Returns
  Class Attribute, null if none matched

Definition at line 1340 of file ezcontentclass.php.

References eZPersistentObject\count(), and eZContentClassAttribute\fetchFilteredList().

## ◆ fetchAttributes()

eZContentClass::fetchAttributes | ( |  | $id = `false`,
|  |  | $asObject = `true`,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`
| ) |  |

Definition at line 1320 of file ezcontentclass.php.

References $ID, $Version, and eZContentClassAttribute\fetchFilteredList().

Referenced by dataMap(), instantiate(), removableInformation(), removeAttributes(), removeTranslation(), setAlwaysAvailableLanguageID(), setVersion(), and store().

## ◆ fetchByIdentifier()

static eZContentClass::fetchByIdentifier | ( |  | $identifier,
|  |  | $asObject = `true`,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`,
|  |  | $user_id = `false`,
|  |  | $parent_id = `null`
| ) |  |
| static

Definition at line 1203 of file ezcontentclass.php.

References eZPersistentObject\count(), definition(), eZPersistentObject\fetchObjectList(), and VERSION_STATUS_DEFINED.

Referenced by eZSiteInstaller\classByIdentifier(), eZContentFunctions\createAndPublishObject(), eZContentUpload\handleLocalFile(), eZContentUpload\handleUpload(), and eZContentClassPackageHandler\install().

## ◆ fetchByRemoteID()

static eZContentClass::fetchByRemoteID | ( |  | $remoteID,
|  |  | $asObject = `true`,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`,
|  |  | $user_id = `false`,
|  |  | $parent_id = `null`
| ) |  |
| static

Definition at line 1170 of file ezcontentclass.php.

References eZPersistentObject\count(), definition(), eZPersistentObject\fetchObjectList(), and VERSION_STATUS_DEFINED.

Referenced by eZContentClassPackageHandler\install(), eZContentObjectPackageHandler\installFetchAliases(), eZContentObjectPackageHandler\installOverrides(), and eZContentClassPackageHandler\uninstall().

## ◆ fetchGroupIDList()

eZContentClass::fetchGroupIDList | ( |  | ) |

Find all groups the current class is placed in and returns a list of group IDs.

Returns
  An array with integers (ids).

See also
  fetchGroupList()

Definition at line 627 of file ezcontentclass.php.

References $InGroupIDs, eZPersistentObject\attribute(), and eZContentClassClassGroup\fetchGroupList().

## ◆ fetchGroupList()

eZContentClass::fetchGroupList | ( |  | ) |

Find all groups the current class is placed in and returns a list of group objects.

Returns
  An array with eZContentClassGroup objects.

See also
  fetchGroupIDList()

Definition at line 614 of file ezcontentclass.php.

References $InGroups, eZPersistentObject\attribute(), and eZContentClassClassGroup\fetchGroupList().

## ◆ fetchIDListContainingDatatype()

static eZContentClass::fetchIDListContainingDatatype | ( |  | $dataTypeString | ) |
| static

Returns an array of IDs of classes containing a specified datatype

Parameters

  $dataTypeString | a datatype identification string

Definition at line 1888 of file ezcontentclass.php.

References eZDB\instance(), and VERSION_STATUS_DEFINED.

Referenced by eZUser\contentClassIDs().

## ◆ fetchList()

static eZContentClass::fetchList | ( |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`,
|  |  | $asObject = `true`,
|  |  | $user_id = `false`,
|  |  | $sorts = `null`,
|  |  | $fields = `null`,
|  |  | $classFilter = `false`,
|  |  | $limit = `null`
| ) |  |
| static

Definition at line 1238 of file ezcontentclass.php.

References definition(), eZPersistentObject\fetchObjectList(), and eZContentClassName\sqlFilter().

Referenced by eZMultiplexerType\attribute(), eZWaitUntilDateType\attribute(), eZUser\canAssignSectionToClassList(), and removeTemporary().

## ◆ fetchMatchGroupIDList()

eZContentClass::fetchMatchGroupIDList | ( |  | ) |

Returns the result from fetchGroupIDList() if class group overrides is enabled in content.ini.

Returns
  An array with eZContentClassGroup objects or `false` if disabled.

Note
  `EnableClassGroupOverride` in group `ContentOverrideSettings` from INI file content.ini controls this behaviour.

Definition at line 647 of file ezcontentclass.php.

References eZPersistentObject\attribute().

## ◆ fetchSearchableAttributes()

eZContentClass::fetchSearchableAttributes | ( |  | $id = `false`,
|  |  | $asObject = `true`,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`
| ) |  |

Definition at line 1352 of file ezcontentclass.php.

References $ID, $Version, and eZContentClassAttribute\fetchFilteredList().

## ◆ hasNameInLanguage()

eZContentClass::hasNameInLanguage | ( |  | $languageLocale | ) |

Definition at line 1547 of file ezcontentclass.php.

## ◆ inGroup()

eZContentClass::inGroup | ( |  | $groupID | ) |

Returns
  true if the class is part of the group $groupID

Definition at line 708 of file ezcontentclass.php.

References eZPersistentObject\attribute(), and eZContentClassClassGroup\classInGroup().

## ◆ initializeCopy()

eZContentClass::initializeCopy | ( | & | $originalClass | ) |

Initializes this class as a copy of $originalClass by creating new a new name and identifier. It will check if there are other classes already with this name in which case it will append a unique number to the name and identifier.

Definition at line 958 of file ezcontentclass.php.

References eZUser\currentUser(), eZDB\instance(), eZPersistentObject\setAttribute(), setName(), and ezpI18n\tr().

## ◆ instantiate()

eZContentClass::instantiate | ( |  | $userID = `false`,
|  |  | $sectionID = `0`,
|  |  | $versionNumber = `false`,
|  |  | $languageCode = `false`,
|  |  | $versionStatus = `eZContentObjectVersion::STATUS_INTERNAL_DRAFT`
| ) |  |

Creates a new content object instance and stores it.

Parameters

  userID | user ID (optional), current user if not set (also store object id in session if $userID = false)
  sectionID | section ID (optional), 0 if not set
  versionNumber | version number, create initial version if not set

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 276 of file ezcontentclass.php.

References eZPersistentObject\attribute(), eZContentObjectVersion\create(), eZContentObject\create(), eZUser\currentUser(), eZContentObject\defaultLanguage(), fetchAttributes(), eZDB\instance(), eZUser\isAnonymous(), name(), eZPreferences\setValue(), ezpI18n\tr(), and eZPreferences\value().

Referenced by instantiateIn().

## ◆ instantiateIn()

eZContentClass::instantiateIn | ( |  | $lang,
|  |  | $userID = `false`,
|  |  | $sectionID = `0`,
|  |  | $versionNumber = `false`,
|  |  | $versionStatus = `eZContentObjectVersion::STATUS_INTERNAL_DRAFT`
| ) |  |

Definition at line 262 of file ezcontentclass.php.

References instantiate().

## ◆ isRemovable()

eZContentClass::isRemovable | ( |  | ) |

Checks if the class can be removed and returns `true` if it can, `false` otherwise.

See also
  removableInformation()

Definition at line 773 of file ezcontentclass.php.

References eZPersistentObject\count(), and removableInformation().

Referenced by remove().

## ◆ languages()

eZContentClass::languages | ( |  | ) |

Wrapper for eZContentClassNameList::languages.

Definition at line 1671 of file ezcontentclass.php.

## ◆ modifier()

eZContentClass::modifier | ( |  | ) |

Returns
  The modifier of the class as an eZUser object by using the $ModifierID as user ID.

Definition at line 600 of file ezcontentclass.php.

References eZUser\fetch().

## ◆ name()

eZContentClass::name | ( |  | $languageLocale = `false` | ) |

Returns a contentclass name in $languageLocale language. Uses siteaccess language list or 'always available' language if $languageLocale is 'false'.

Returns
  string with contentclass name.

Definition at line 1559 of file ezcontentclass.php.

Referenced by instantiate().

## ◆ nameFromSerializedString()

static eZContentClass::nameFromSerializedString | ( |  | $serializedNameList | ) |
| static

Returns a contentclass name from serialized array $serializedNameList using top language from siteaccess language list or 'always available' name from $serializedNameList.

Returns
  string with contentclass name.

Definition at line 1529 of file ezcontentclass.php.

References eZSerializedObjectNameList\nameFromSerializedString().

Referenced by eZContentObject\__construct(), eZContentObject\className(), eZContentStructureTreeOperator\createContentStructureNode(), eZContentObject\fetchIDArray(), eZContentObjectTreeNode\makeObjectsArray(), and eZContentObject\relatedObjects().

## ◆ nameList()

eZContentClass::nameList | ( |  | ) |

Definition at line 1575 of file ezcontentclass.php.

## ◆ objectCount()

eZContentClass::objectCount | ( |  | ) |

Returns
  will return the number of objects published by this class.

Definition at line 1485 of file ezcontentclass.php.

References eZDB\instance(), and eZContentObject\STATUS_PUBLISHED.

## ◆ objectList()

eZContentClass::objectList | ( |  | ) |

Returns
  will return the list of objects published by this class.

Definition at line 1498 of file ezcontentclass.php.

References eZContentObject\fetchSameClassList().

## ◆ prioritizedLanguages()

eZContentClass::prioritizedLanguages | ( |  | ) |

Wrapper for eZContentClassNameList::prioritizedLanguages.

Definition at line 1679 of file ezcontentclass.php.

## ◆ prioritizedLanguagesJsArray()

eZContentClass::prioritizedLanguagesJsArray | ( |  | ) |

Definition at line 1684 of file ezcontentclass.php.

## ◆ remoteID()

eZContentClass::remoteID | ( |  | ) |

Get remote id of content node

Definition at line 738 of file ezcontentclass.php.

References eZPersistentObject\attribute(), eZRemoteIdUtility\generate(), eZPersistentObject\setAttribute(), sync(), and VERSION_STATUS_DEFINED.

## ◆ removableInformation()

eZContentClass::removableInformation | ( |  | $includeAll = `true` | ) |

Returns information on why the class cannot be removed, it does the same checks as in isRemovable() but generates some text in the return array.

Returns
  An array which contains:
  - text - Plain text description why this cannot be removed
  - list - An array with reasons why this failed, each entry contains:
    - text - Plain text description of the reason.
    - list - A sublist of reason (e.g from an attribute), is optional.

Parameters

  $includeAll | Controls whether the returned information will contain all sources for not being to remove or just the first that it finds.

Definition at line 791 of file ezcontentclass.php.

References eZPersistentObject\attribute(), eZPersistentObject\count(), fetchAttributes(), eZDB\instance(), ezpI18n\tr(), and eZDebug\writeError().

Referenced by isRemovable().

## ◆ remove()

eZContentClass::remove | ( |  | $removeAttributes = `false`,
|  |  | $version = `eZContentClass::VERSION_STATUS_DEFINED`
| ) |  |

Note
  If you want to remove a class with all data associated with it (objects/classMembers) you should use eZContentClassOperations::remove()

Reimplemented from eZPersistentObject.

Definition at line 756 of file ezcontentclass.php.

References isRemovable(), removeAttributes(), and VERSION_STATUS_DEFINED.

## ◆ removeAttributes()

eZContentClass::removeAttributes | ( |  | $removeAttributes = `false`,
|  |  | $version = `false`
| ) |  |

Note
  Removes class attributes

Parameters

  removeAttributes | Array of attributes to remove
  version | Version to remove( optional )

Definition at line 844 of file ezcontentclass.php.

References $ID, $Version, eZContentClassAttribute\definition(), fetchAttributes(), eZDB\instance(), eZPersistentObject\removeObject(), and eZDebug\writeError().

Referenced by remove(), and storeVersioned().

## ◆ removeTemporary()

static eZContentClass::removeTemporary | ( |  | ) |
| static

Will remove all temporary classes from the database.

Definition at line 719 of file ezcontentclass.php.

References eZContentClassAttribute\definition(), fetchList(), eZDB\instance(), eZPersistentObject\removeObject(), and VERSION_STATUS_TEMPORARY.

## ◆ removeTranslation()

eZContentClass::removeTranslation | ( |  | $languageID | ) |

Removes translated name for specified by $languageID language.

Definition at line 1729 of file ezcontentclass.php.

References eZPersistentObject\attribute(), eZContentLanguage\fetch(), fetchAttributes(), eZDB\instance(), eZPersistentObject\setAttribute(), and store().

## ◆ setAlwaysAvailableLanguageID()

eZContentClass::setAlwaysAvailableLanguageID | ( |  | $languageID,
|  |  | $updateChilds = `true`
| ) |  |

Definition at line 1601 of file ezcontentclass.php.

References eZPersistentObject\attribute(), eZContentLanguage\fetch(), fetchAttributes(), eZDB\instance(), eZPersistentObject\setAttribute(), and store().

Referenced by clearAlwaysAvailableLanguageID().

## ◆ setCanInstantiateLanguages()

eZContentClass::setCanInstantiateLanguages | ( |  | $languageCodes | ) |

Returns
  Sets the languages which are allowed to be instantiated for the class. Used only for the content/ fetch function.

Definition at line 1507 of file ezcontentclass.php.

## ◆ setDescription()

eZContentClass::setDescription | ( |  | $description,
|  |  | $languageLocale = `false`
| ) |  |

Definition at line 1591 of file ezcontentclass.php.

## ◆ setName()

eZContentClass::setName | ( |  | $name,
|  |  | $languageLocale = `false`
| ) |  |

Definition at line 1564 of file ezcontentclass.php.

References eZPersistentObject\attribute(), eZContentLanguage\idByLocale(), eZPersistentObject\setAttribute(), and topPriorityLanguageLocale().

Referenced by initializeCopy().

## ◆ setVersion()

eZContentClass::setVersion | ( |  | $version,
|  |  | $set_childs = `false`
| ) |  |

Definition at line 1068 of file ezcontentclass.php.

References fetchAttributes(), and eZPersistentObject\setAttribute().

Referenced by storeVersioned().

## ◆ store()

eZContentClass::store | ( |  | $store_childs = `false`,
|  |  | $fieldFilters = `null`
| ) |  |

Definition at line 905 of file ezcontentclass.php.

References expireCache(), fetchAttributes(), eZDB\instance(), and eZPersistentObject\setAttribute().

Referenced by removeTranslation(), setAlwaysAvailableLanguageID(), and sync().

## ◆ storeDefined()

eZContentClass::storeDefined | ( |  | $attributes | ) |

Stores the current class as a defined version, updates the contentobject_name attribute and recreates the class group entries.

Note
  It will remove any existing temporary or defined classes before storing.

Parameters

  array | $attributes | array of attributes of the content class

Definition at line 993 of file ezcontentclass.php.

References storeVersioned().

## ◆ storeVersioned()

eZContentClass::storeVersioned | ( |  | $attributes,
|  |  | $version
| ) |  |

Stores the current class as a modified version, updates the contentobject_name attribute and recreates the class group entries.

Note
  It will remove classes in the previous and specified version before storing.

Parameters

  array | $attributes | array of attributes
  int | $version | version status

Since
  Version 4.3

Definition at line 1008 of file ezcontentclass.php.

References adjustAttributePlacements(), eZPersistentObject\attribute(), eZContentCacheManager\clearAllContentCache(), eZPersistentObject\count(), eZUser\currentUser(), eZContentClassClassGroup\fetchGroupList(), eZDB\instance(), removeAttributes(), eZContentClassClassGroup\removeClassMembers(), eZPersistentObject\setAttribute(), and setVersion().

Referenced by storeDefined().

## ◆ sync()

eZContentClass::sync | ( |  | $fieldFilters = `null` | ) |

Makes sure data is stored if the data is considered dirty.

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 946 of file ezcontentclass.php.

References eZPersistentObject\hasDirtyData(), and store().

Referenced by remoteID().

## ◆ topPriorityLanguageLocale()

eZContentClass::topPriorityLanguageLocale | ( |  | ) |

Wrapper for eZContentClassNameList::topPriorityLanguageLocale.

Definition at line 1700 of file ezcontentclass.php.

Referenced by setName().

## ◆ urlAliasName()

eZContentClass::urlAliasName | ( | eZContentObject | $contentObject,
|  |  | $version = `false`,
|  |  | $translation = `false`
| ) |  |

Will generate a name for the url alias based on the class settings for content object limited by site.ini[URLTranslator]\UrlAliasNameLimit

Parameters

  eZContentObject | $contentObject |
  int | false | $version |
  string | false | $translation |

Returns
  string

Definition at line 1423 of file ezcontentclass.php.

References $ContentObjectName, and eZPersistentObject\$URLAliasName.

## ◆ versionCount()

eZContentClass::versionCount | ( |  | ) |

Deprecated:

Returns
  The version count for the class if has been determined.

Definition at line 1383 of file ezcontentclass.php.

References $VersionCount.

## ◆ versionHistoryLimit()

static eZContentClass::versionHistoryLimit | ( |  | $class | ) |
| static

Computes the version history limit for a content class

Parameters

  mixed | $class | Content class ID, content class identifier or content class object

Returns
  int

Since
  4.2

Definition at line 1927 of file ezcontentclass.php.

References classIDByIdentifier(), classIdentifierByID(), and eZDebug\writeWarning().

Referenced by eZContentObject\createNewVersion().

## ◆ versionStatus()

eZContentClass::versionStatus | ( |  | ) |

Definition at line 1365 of file ezcontentclass.php.

References VERSION_STATUS_DEFINED, VERSION_STATUS_MODIFIED, and VERSION_STATUS_TEMPORARY.

## Member Data Documentation

## ◆ $AllGroups

eZContentClass::$AllGroups

Definition at line 2016 of file ezcontentclass.php.

Referenced by fetchAllGroups().

## ◆ $CanInstantiateLanguages

eZContentClass::$CanInstantiateLanguages

Definition at line 2018 of file ezcontentclass.php.

## ◆ $ContentObjectName

eZContentClass::$ContentObjectName

Definition at line 2008 of file ezcontentclass.php.

Referenced by contentObjectName(), and urlAliasName().

## ◆ $Created

eZContentClass::$Created

Definition at line 2013 of file ezcontentclass.php.

## ◆ $CreatorID

eZContentClass::$CreatorID

Definition at line 2011 of file ezcontentclass.php.

## ◆ $DataMap

eZContentClass::$DataMap

Definition at line 2020 of file ezcontentclass.php.

## ◆ $DescriptionList

eZContentClass::$DescriptionList

Definition at line 2006 of file ezcontentclass.php.

## ◆ $ID

eZContentClass::$ID

Definition at line 2000 of file ezcontentclass.php.

Referenced by fetchAttributes(), fetchSearchableAttributes(), and removeAttributes().

## ◆ $Identifier

eZContentClass::$Identifier

Definition at line 2007 of file ezcontentclass.php.

## ◆ $identifierHash

eZContentClass::$identifierHash = null
| static private

In-memory cache for class identifiers / id matching

Definition at line 2025 of file ezcontentclass.php.

Referenced by classIDByIdentifier(), classIdentifierByID(), and classIdentifiersHash().

## ◆ $InGroupIDs

eZContentClass::$InGroupIDs

Definition at line 21 of file ezcontentclass.php.

Referenced by fetchGroupIDList().

## ◆ $InGroups

eZContentClass::$InGroups

Definition at line 2015 of file ezcontentclass.php.

Referenced by fetchGroupList().

## ◆ $IsContainer

eZContentClass::$IsContainer

Definition at line 2017 of file ezcontentclass.php.

## ◆ $LanguageMask

eZContentClass::$LanguageMask

Definition at line 2019 of file ezcontentclass.php.

## ◆ $Modified

eZContentClass::$Modified

Definition at line 2014 of file ezcontentclass.php.

## ◆ $ModifierID

eZContentClass::$ModifierID

Definition at line 2012 of file ezcontentclass.php.

## ◆ $NameList

eZContentClass::$NameList

Definition at line 2004 of file ezcontentclass.php.

## ◆ $SerializedNameList

eZContentClass::$SerializedNameList

Definition at line 2002 of file ezcontentclass.php.

## ◆ $Version

eZContentClass::$Version

Definition at line 2009 of file ezcontentclass.php.

Referenced by dataMap(), fetchAttributes(), fetchSearchableAttributes(), and removeAttributes().

## ◆ $VersionCount

eZContentClass::$VersionCount

Definition at line 2010 of file ezcontentclass.php.

Referenced by versionCount().

## ◆ CONTENT_OBJECT_NAME_MAX_LENGTH

const eZContentClass::CONTENT_OBJECT_NAME_MAX_LENGTH = 255

Definition at line 30 of file ezcontentclass.php.

Referenced by contentObjectName().

## ◆ VERSION_STATUS_DEFINED

const eZContentClass::VERSION_STATUS_DEFINED = 0

Definition at line 22 of file ezcontentclass.php.

Referenced by eZSiteInstaller\addClassAttributes(), eZMultiplexerType\attribute(), eZWaitUntilDateType\attribute(), eZUser\canAssignSectionToClassList(), eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), canInstantiateClassList(), exists(), fetch(), fetchAllClasses(), eZContentObject\fetchAttributesByIdentifier(), fetchByIdentifier(), fetchByRemoteID(), fetchIDListContainingDatatype(), eZUser\fetchUserClassList(), eZUser\fetchUserGroupClassNames(), eZDataType\preStoreVersionedClassAttribute(), eZCache\purgeImageAlias(), remoteID(), remove(), eZContentClassAttribute\storeDefined(), eZEnumType\storeDefinedClassAttribute(), eZDataType\storeVersionedClassAttribute(), and versionStatus().

## ◆ VERSION_STATUS_MODIFIED

const eZContentClass::VERSION_STATUS_MODIFIED = 2

Definition at line 24 of file ezcontentclass.php.

Referenced by eZDataType\preStoreVersionedClassAttribute(), eZEnumType\storeModifiedClassAttribute(), eZDataType\storeVersionedClassAttribute(), and versionStatus().

## ◆ VERSION_STATUS_TEMPORARY

const eZContentClass::VERSION_STATUS_TEMPORARY = 1

Definition at line 23 of file ezcontentclass.php.

Referenced by eZContentClassAttribute\create(), removeTemporary(), and versionStatus().

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

- ezcontentclass.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.