kernel/private/api/content/field_set.php
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
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

string
$activeLanguage= 'false'
Currently active language, as a locale
falseDetails- Type
- string

\array(
$childrenFieldSets= ''
Reference to the known children field sets Indexed by locale: xxx-XX => ezpContentFieldSet
ezpContentFieldSet )- Type
- \array(

$fields= ''
Fields set content object attributes array( identifier => eZContentObjectAttribute )
- Type
- n/a

array
$iteratorData= 'null'
Reference to the actual iterator data source Either self::fields, or self::childreFieldSets[language]::fields
nullDetails- Type
- array

\ezpContentFieldSet
$parentFieldSet= ''
Reference to the parent field set
- Type
- \ezpContentFieldSet
Methods

__get(
$name
)
:
mixedGetter. Used to get attributes values.
| Name | Type | Description |
|---|---|---|
| $name |
| Type | Description |
|---|---|
| mixed |

__isset(
$name
)
:
voidUsed to check if an attribute has content:
if ( isset( $content->fields->title ) ) <= no title
| Name | Type | Description |
|---|---|---|
| $name |
- See
- \ezContentObjectAttribute->hasContent()

__set(
$name, $value
)
:
voidSetter. Used to set attributes values.
| Name | Type | Description |
|---|---|---|
| $name | ||
| $value |

fromContentObject(
\eZContentObject $contentObject
)
:
\ezpContentFieldSetInitializes a level one ezpContentFieldSet from an eZContentObject
| Name | Type | Description |
|---|---|---|
| $contentObject | \eZContentObject |
| Type | Description |
|---|---|
| \ezpContentFieldSet |

fromDataMap(
array $dataMap
)
:
\ezpContentFieldSetInitializes a level two ezpContentFieldSet from a content object data map
| Name | Type | Description |
|---|---|---|
| $dataMap | array |
| Type | Description |
|---|---|
| \ezpContentFieldSet |

offsetExists(
$offset
)
:
voidArray 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
| Name | Type | Description |
|---|---|---|
| $offset |

offsetGet(
$offset
)
:
\ezpContentFieldSetArray get handler.
Will return the requested language's ezpFieldSet
| Name | Type | Description |
|---|---|---|
| $offset |
| Type | Description |
|---|---|
| \ezpContentFieldSet |

offsetSet(
$offset, $value
)
:
voidArray 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.
| Name | Type | Description |
|---|---|---|
| $offset | ||
| $value |

offsetUnset(
$offset
)
:
voidUnset array handler.
Should we allow a user to remove a language by using that syntax:
unset( $content->fields['eng-GB'] );
| Name | Type | Description |
|---|---|---|
| $offset |

setActiveLanguage(
string $language
)
:
voidSets the currently active language when reading attribute(/object/node) properties
| Name | Type | Description |
|---|---|---|
| $language | string | Language locale (xxx-XX) |