kernel/private/api/content/content.php
File containing the ezpContent class.
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- API
- Version
- 4.6.0
\ezpContent
Class that represents a content item.
A content item is an abstract representation of a contentobject + contentobjecttreenode + attributes Provides full access to a content's data: - fields (attributes) per language - content metadata (publishing date, owner, etc) - content locations
Example 1, with a one language object:
$article = ezpContent::create( 'article' );
$article->fields->title = 'foo';
$article->fields->name = 'bar';
Example 2, with a multilingual object:
$article = ezpContent::create( 'article' );
$article->fields['eng-GB']->title = 'foo';
$article->fields['eng-GB']->name = 'bar';
$article->fields['fre-FR']->title = 'foo';
$article->fields['fre-FR']->name = 'bar';
Example 3, with a multilingual object but an alternative syntax
$article = ezpContent::create( 'article' );
$article->setActiveLanguage( 'eng-GB' );
$article->fields->title = 'foo';
$article->fields->name = 'bar';
$article->active_language = 'fre-FR';
$article->fields->title = 'foo';
$article->fields->name = 'bar';
Properties


string
= ''
classIdentifier The content class identifier
classIdentifier The content class identifier- Type
- string
- Magic
- Property-read
- classIdentifier The content class identifier


int
= ''
datePublished The date the object was initially published, as a UNIX timestamp
datePublished The date the object was initially published, as a UNIX timestamp- Type
- int
- Magic
- Property-read
- datePublished The date the object was initially published, as a UNIX timestamp


int
= ''
dateModified The date the object was last modified, as a UNIX timestamp
dateModified The date the object was last modified, as a UNIX timestamp- Type
- int
- Magic
- Property-read
- dateModified The date the object was last modified, as a UNIX timestamp


string
= ''
name The object's name in the active language
name The object's name in the active language- Type
- string
- Magic
- Property-read
- name The object's name in the active language
Methods


create(
string $contentType
)
:
\ezpContent
Instanciates a new content item
Name | Type | Description |
---|---|---|
$contentType | string | The content class (article, folder, etc) |
Type | Description |
---|---|
\ezpContent |


fromNode(
\eZContentObjectTreeNode $node, $checkAccess
=
true
)
:
\ezpContent
Instanciates an ezpContent from an eZContentObjectTreeNode
Name | Type | Description |
---|---|---|
$node | \eZContentObjectTreeNode | |
$checkAccess |
Type | Description |
---|---|
\ezpContent |


fromNodeId(
int $nodeId, $checkAccess
=
true
)
:
\ezpContent
Instanciates an ezpContent from an eZContentObjectTreenode Id
Name | Type | Description |
---|---|---|
$nodeId | int | |
$checkAccess |
Type | Description |
---|---|
\ezpContent |


fromObject(
$object, $checkAccess
=
true
)
:
\ezpContent
Instanciates an ezpContent from an eZContentObject
Name | Type | Description |
---|---|---|
$object | ||
$checkAccess |
Type | Description |
---|---|
\ezpContent |


fromObjectId(
int $objectId, $checkAccess
=
true
)
:
\ezpContent
Instanciates an ezpContent from an eZContentObject Id
Name | Type | Description |
---|---|---|
$objectId | int | |
$checkAccess |
Type | Description |
---|---|
\ezpContent |