eZ Publish Community Project (Legacy Stack) 2013.4
Class

ezpContent

class 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

ezpContentFieldSet $fields Content (object) attributes
ezpContentLocationSet $locations Content locations
string $activeLanguage Active content language for this object

Methods

static ezpContent create(string $contentType)

Instanciates a new content item

static ezpContent fromNode(eZContentObjectTreeNode $node, $checkAccess = true)

Instanciates an ezpContent from an eZContentObjectTreeNode

static ezpContent fromNodeId($nodeId, $checkAccess = true)

Instanciates an ezpContent from an eZContentObjectTreenode Id

static ezpContent fromObjectId($objectId, $checkAccess = true)

Instanciates an ezpContent from an eZContentObject Id

static ezpContent fromObject(eZContentObject $object, $checkAccess = true)

Instanciates an ezpContent from an eZContentObject

void setActiveLanguage($language)

Sets the currently active language for attributes handling

__get($property)

Details

at line 63
static public ezpContent create(string $contentType)

Instanciates a new content item

Parameters

string $contentType The content class (article, folder, etc)

Return Value

ezpContent

at line 72
static public ezpContent fromNode(eZContentObjectTreeNode $node, $checkAccess = true)

Instanciates an ezpContent from an eZContentObjectTreeNode

Parameters

eZContentObjectTreeNode $node
$checkAccess

Return Value

ezpContent

at line 93
static public ezpContent fromNodeId($nodeId, $checkAccess = true)

Instanciates an ezpContent from an eZContentObjectTreenode Id

Parameters

$nodeId
$checkAccess

Return Value

ezpContent

at line 107
static public ezpContent fromObjectId($objectId, $checkAccess = true)

Instanciates an ezpContent from an eZContentObject Id

Parameters

$objectId
$checkAccess

Return Value

ezpContent

at line 121
static public ezpContent fromObject(eZContentObject $object, $checkAccess = true)

Instanciates an ezpContent from an eZContentObject

Parameters

eZContentObject $object
$checkAccess

Return Value

ezpContent

at line 141
public void setActiveLanguage($language)

Sets the currently active language for attributes handling

Parameters

$language

Return Value

void

at line 147
public __get($property)

Parameters

$property