kernel/private/api/content/field_set.php

Show: inherited
Table of Contents

File containing the ezpContentFieldSet 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  

\ezpContentFieldSet

Package: API

Allows for reading/writing of content fields (attributes) through an array like interface. This class is aimed at being used through an ezpContent object, and usage examples can be found there.

Parent(s)
?\ArrayAccess\Iterator

Properties

Propertyprotectedstring  $activeLanguage= 'false'

Currently active language, as a locale

Default valuefalseDetails
Type
string
Propertyprotected\array(  $childrenFieldSets= ''

Reference to the known children field sets Indexed by locale: xxx-XX => ezpContentFieldSet

ezpContentFieldSet )
Details
Type
\array(
Propertyprotected  $fields= ''

Fields set content object attributes array( identifier => eZContentObjectAttribute )

Details
Type
n/a
Propertyprotectedarray  $iteratorData= 'null'

Reference to the actual iterator data source Either self::fields, or self::childreFieldSets[language]::fields

Default valuenullDetails
Type
array
Propertyprotectedarray  $iteratorPointer= 'null'

Pointer used by the iterator

Default valuenullDetails
Type
array
Propertyprotected\ezpContentFieldSet  $parentFieldSet= ''

Reference to the parent field set

Details
Type
\ezpContentFieldSet

Methods

methodpublic__construct( ) : void

Initializes the fields set with a content object + language

methodpublic__get(  $name ) : mixed

Getter. Used to get attributes values.

Parameters
Name Type Description
$name
Returns
Type Description
mixed
methodpublic__isset(  $name ) : void

Used to check if an attribute has content: if ( isset( $content->fields->title ) ) <= no title

Parameters
Name Type Description
$name
Details
See
\ezContentObjectAttribute->hasContent()  
methodpublic__set(  $name,  $value ) : void

Setter. Used to set attributes values.

Parameters
Name Type Description
$name
$value
methodpubliccurrent( ) : void

Iterator::current()

methodpublicfromContentObject( \eZContentObject $contentObject ) : \ezpContentFieldSet
static

Initializes a level one ezpContentFieldSet from an eZContentObject

Parameters
Name Type Description
$contentObject \eZContentObject
Returns
Type Description
\ezpContentFieldSet
methodpublicfromDataMap( array $dataMap ) : \ezpContentFieldSet
static

Initializes a level two ezpContentFieldSet from a content object data map

Parameters
Name Type Description
$dataMap array
Returns
Type Description
\ezpContentFieldSet
methodprotectedinitIterator( ) : void

Initializes the iterator based on the current field / languages list

methodpublickey( ) : void

Iterator::key()

methodpublicnext( ) : void

Iterator::next()

methodpublicoffsetExists(  $offset ) : void

Array exists handler. Can be used to check for existence of a language

Again, this operation might not belong to the fields set (data map) but to the content itself

Parameters
Name Type Description
$offset
methodpublicoffsetGet(  $offset ) : \ezpContentFieldSet

Array get handler.

Will return the requested language's ezpFieldSet

Parameters
Name Type Description
$offset
Returns
Type Description
\ezpContentFieldSet
methodpublicoffsetSet(  $offset,  $value ) : void

Array set hander.

Will set the requested language's ezpFieldSet. Is that any good ? Might be used to enable a language on a content item:

$article->fields['fre-FR'] = true

Semantically speaking, this belongs to the content, not the fields. Maybe no need to implement that.

Parameters
Name Type Description
$offset
$value
methodpublicoffsetUnset(  $offset ) : void

Unset array handler.

Should we allow a user to remove a language by using that syntax:

unset( $content->fields['eng-GB'] );
Parameters
Name Type Description
$offset
methodpublicrewind( ) : void

Iterator::rewind()

methodpublicsetActiveLanguage( string $language ) : void

Sets the currently active language when reading attribute(/object/node) properties

Parameters
Name Type Description
$language string

Language locale (xxx-XX)

methodpublicvalid( ) : void

Iterator::valid()

Documentation was generated by DocBlox 0.18.1.