kernel/classes/ezcontentclass.php
File containing the eZContentClass class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
\eZContentClass
File containing the eZContentClass class.
- Parent(s)
- \eZPersistentObject
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Version
- 4.6.0
Constants
Properties

$PersistentDataDirty= ''
- Type
- n/a
- Inherited_from
- \eZPersistentObject::$$PersistentDataDirty
Methods

attribute(
$attr, $noFunction
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $attr | ||
| $noFunction |

buildContentObjectName(
$contentObjectName, $dataMap, $tmpTags
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $contentObjectName | ||
| $dataMap | ||
| $tmpTags |

canInstantiateClassList(
$asObject
=
false, $includeFilter
=
true, $groupList
=
false, $fetchID
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $asObject | ||
| $includeFilter | ||
| $groupList | ||
| $fetchID |

classIDByIdentifier(
string | array $identifier
)
:
int | falseResolves the string class identifier $identifier to its numeric value Use {@link eZContentObjectTreeNode::classIDByIdentifier()} for < 4.1.
If multiple classes have the same identifier, the first found is returned.
| Name | Type | Description |
|---|---|---|
| $identifier | string | array | identifier string or array of identifiers (array support added in 4.1.1) |
| Type | Description |
|---|---|
| int | false | Returns classid or false |
- Since
- Version 4.1
- Static

classIdentifierByID(
$id
)
:
string | falseResolves the numeric class identifier $id to its string value
| Name | Type | Description |
|---|---|---|
| $id |
| Type | Description |
|---|---|
| string | false | Returns classidentifier or false |
- Since
- Version 4.1
- Static

classIdentifiersHash(
)
:
arrayReturns the class identifier hash for the current database.
If it is outdated or non-existent, the method updates/generates the file
| Type | Description |
|---|---|
| array | Returns hash of classidentifier => classid |
- Access
- protected
- Since
- Version 4.1
- Static

contentObjectName(
\eZContentObject $contentObject, int | false $version
=
false, string | false $translation
=
false
)
:
stringWill generate a name for the content object based on the class settings for content object limited by self::CONTENT_OBJECT_NAME_MAX_LENGTH.
| Name | Type | Description |
|---|---|---|
| $contentObject | \eZContentObject | |
| $version | int | false | |
| $translation | string | false |
| Type | Description |
|---|---|
| string |

count(
$def, $conds
=
null, $field
=
null
)
:
void
| Name | Type | Description |
|---|---|---|
| $def | ||
| $conds | ||
| $field |

create(
$userID
=
false, $optionalValues
=
array(), $languageLocale
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $userID | ||
| $optionalValues | ||
| $languageLocale |

descriptionFromSerializedString(
$serializedDescriptionList
)
:
void| Name | Type | Description |
|---|---|---|
| $serializedDescriptionList |

eZPersistentObject(
$row
)
:
void| Name | Type | Description |
|---|---|---|
| $row |

exists(
$id, $version
=
eZContentClass::VERSION_STATUS_DEFINED, $userID
=
false, $useIdentifier
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $id | ||
| $version | ||
| $userID | ||
| $useIdentifier |

expireCache(
)
:
voidExpires in-memory cache for eZContentClass.
Clears cache for fetched eZContentClass objects, class identifiers and class attributes.
- Since
- 4.2

fetch(
$id, $asObject
=
true, $version
=
eZContentClass::VERSION_STATUS_DEFINED, $user_id
=
false, $parent_id
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $id | ||
| $asObject | ||
| $version | ||
| $user_id | ||
| $parent_id |

fetchAllClasses(
$asObject
=
true, $includeFilter
=
true, $groupList
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $asObject | ||
| $includeFilter | ||
| $groupList |

fetchAttributeByIdentifier(
$identifier, $asObject
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $identifier | ||
| $asObject |

fetchAttributes(
$id
=
false, $asObject
=
true, $version
=
eZContentClass::VERSION_STATUS_DEFINED
)
:
void| Name | Type | Description |
|---|---|---|
| $id | ||
| $asObject | ||
| $version |

fetchByIdentifier(
$identifier, $asObject
=
true, $version
=
eZContentClass::VERSION_STATUS_DEFINED, $user_id
=
false, $parent_id
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $identifier | ||
| $asObject | ||
| $version | ||
| $user_id | ||
| $parent_id |

fetchByRemoteID(
$remoteID, $asObject
=
true, $version
=
eZContentClass::VERSION_STATUS_DEFINED, $user_id
=
false, $parent_id
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $remoteID | ||
| $asObject | ||
| $version | ||
| $user_id | ||
| $parent_id |

fetchIDListContainingDatatype(
$dataTypeString
)
:
void| Name | Type | Description |
|---|---|---|
| $dataTypeString |

fetchList(
$version
=
eZContentClass::VERSION_STATUS_DEFINED, $asObject
=
true, $user_id
=
false, $sorts
=
null, $fields
=
null, $classFilter
=
false, $limit
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $version | ||
| $asObject | ||
| $user_id | ||
| $sorts | ||
| $fields | ||
| $classFilter | ||
| $limit |

fetchObject(
$def, $field_filters, $conds, $asObject
=
true, $grouping
=
null, $custom_fields
=
null
)
:
void
| Name | Type | Description |
|---|---|---|
| $def | ||
| $field_filters | ||
| $conds | ||
| $asObject | ||
| $grouping | ||
| $custom_fields |

fetchObjectList(
$def, $field_filters
=
null, $conds
=
null, $sorts
=
null, $limit
=
null, $asObject
=
true, $grouping
=
false, $custom_fields
=
null, $custom_tables
=
null, $custom_conds
=
null
)
:
void
| Name | Type | Description |
|---|---|---|
| $def | ||
| $field_filters | ||
| $conds | ||
| $sorts | ||
| $limit | ||
| $asObject | ||
| $grouping | ||
| $custom_fields | ||
| $custom_tables | ||
| $custom_conds |

fetchSearchableAttributes(
$id
=
false, $asObject
=
true, $version
=
eZContentClass::VERSION_STATUS_DEFINED
)
:
void| Name | Type | Description |
|---|---|---|
| $id | ||
| $asObject | ||
| $version |

fill(
$row
)
:
void| Name | Type | Description |
|---|---|---|
| $row |

getShortAttributeName(
$db, $def, $attrName
)
:
void
| Name | Type | Description |
|---|---|---|
| $db | ||
| $def | ||
| $attrName |

handleRows(
$rows, $class_name, $asObject
)
:
void
| Name | Type | Description |
|---|---|---|
| $rows | ||
| $class_name | ||
| $asObject |

hasAttribute(
$attr
)
:
void| Name | Type | Description |
|---|---|---|
| $attr |

instantiate(
$userID
=
false, $sectionID
=
0, $versionNumber
=
false, $languageCode
=
false, $versionStatus
=
eZContentObjectVersion::STATUS_INTERNAL_DRAFT
)
:
void| Name | Type | Description |
|---|---|---|
| $userID | ||
| $sectionID | ||
| $versionNumber | ||
| $languageCode | ||
| $versionStatus |

instantiateIn(
$lang, $userID
=
false, $sectionID
=
0, $versionNumber
=
false, $versionStatus
=
eZContentObjectVersion::STATUS_INTERNAL_DRAFT
)
:
void| Name | Type | Description |
|---|---|---|
| $lang | ||
| $userID | ||
| $sectionID | ||
| $versionNumber | ||
| $versionStatus |

nameFromSerializedString(
$serializedNameList
)
:
void| Name | Type | Description |
|---|---|---|
| $serializedNameList |

newObjectOrder(
$def, $orderField, $conditions
)
:
void
| Name | Type | Description |
|---|---|---|
| $def | ||
| $orderField | ||
| $conditions |

remove(
$removeAttributes
=
false, $version
=
eZContentClass::VERSION_STATUS_DEFINED
)
:
void| Name | Type | Description |
|---|---|---|
| $removeAttributes | ||
| $version |

removeAttributes(
$removeAttributes
=
false, $version
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $removeAttributes | ||
| $version |

removeObject(
$def, $conditions
=
null, $extraConditions
=
null
)
:
void
| Name | Type | Description |
|---|---|---|
| $def | ||
| $conditions | ||
| $extraConditions |

reorderObject(
$def, $orderField, $conditions, $down
=
true
)
:
void
| Name | Type | Description |
|---|---|---|
| $def | ||
| $orderField | ||
| $conditions | ||
| $down |

replaceFieldsWithShortNames(
$db, $fieldDefs, $fields
)
:
void
| Name | Type | Description |
|---|---|---|
| $db | ||
| $fieldDefs | ||
| $fields |

setAlwaysAvailableLanguageID(
$languageID, $updateChilds
=
true
)
:
void| Name | Type | Description |
|---|---|---|
| $languageID | ||
| $updateChilds |

setAttribute(
$attr, $val
)
:
void| Name | Type | Description |
|---|---|---|
| $attr | ||
| $val |

setDescription(
$description, $languageLocale
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $description | ||
| $languageLocale |

setHasDirtyData(
$hasDirtyData
)
:
void| Name | Type | Description |
|---|---|---|
| $hasDirtyData |

setName(
$name, $languageLocale
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $name | ||
| $languageLocale |

setVersion(
$version, $set_childs
=
false
)
:
void| Name | Type | Description |
|---|---|---|
| $version | ||
| $set_childs |

store(
$store_childs
=
false, $fieldFilters
=
null
)
:
void| Name | Type | Description |
|---|---|---|
| $store_childs | ||
| $fieldFilters |

storeDefined(
array $attributes
)
:
voidStores the current class as a defined version, updates the contentobject_name attribute and recreates the class group entries.
| Name | Type | Description |
|---|---|---|
| $attributes | array | array of attributes of the content class |
- Note
- It will remove any existing temporary or defined classes before storing.

storeObject(
$obj, $fieldFilters
=
null
)
:
void
| Name | Type | Description |
|---|---|---|
| $obj | ||
| $fieldFilters |

storeVersioned(
array $attributes, int $version
)
:
voidStores the current class as a modified version, updates the contentobject_name attribute and recreates the class group entries.
| Name | Type | Description |
|---|---|---|
| $attributes | array | array of attributes |
| $version | int | version status |
- Note
- It will remove classes in the previous and specified version before storing.
- Since
- Version 4.3

swapRow(
$table, $keys, $order_id, $rows, $id1, $id2
)
:
void
| Name | Type | Description |
|---|---|---|
| $table | ||
| $keys | ||
| $order_id | ||
| $rows | ||
| $id1 | ||
| $id2 |

urlAliasName(
\eZContentObject $contentObject, int | false $version
=
false, string | false $translation
=
false
)
:
stringWill generate a name for the url alias based on the class settings for content object limited by site.ini\[URLTranslator]\UrlAliasNameLimit
| Name | Type | Description |
|---|---|---|
| $contentObject | \eZContentObject | |
| $version | int | false | |
| $translation | string | false |
| Type | Description |
|---|---|
| string |

versionHistoryLimit(
mixed $class
)
:
intComputes the version history limit for a content class
| Name | Type | Description |
|---|---|---|
| $class | mixed | Content class ID, content class identifier or content class object |
| Type | Description |
|---|---|
| int |
- Since
- 4.2