PHP Класс Jackalope\Property

It has a single parent node and no children. A property consists of a name and a value, or in the case of multi-value properties, a set of values all of the same type.
Наследование: extends Item, implements IteratorAggregate, implements PHPCR\PropertyInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$definition PHPCR\NodeType\PropertyDefinitionInterface cached instance of the property definition that defines this property
$isMultiple boolean whether this is a multivalue property
$length integer length is only used for binary property, because binary loading is delayed until explicitly requested.
$streams array All binary stream wrapper instances
$type integer the type constant from PropertyType
$value mixed The property value in suitable native format or object
$wrapBinaryStreams boolean flag to know if binary streams should be wrapped or retrieved immediately. this is a per session setting.

Открытые методы

Метод Описание
__construct ( jackalope\FactoryInterface $factory, array $data, string $path, jackalope\Session $session, ObjectManager $objectManager, boolean $new = false ) Create a property, either from server data or locally
__destruct ( ) Close all open binary stream wrapper instances on shutdown.
_setLength ( integer $length ) Internally used after refresh from backend to set new length
_setValue ( mixed $value, integer | string $type = PropertyType::UNDEFINED, boolean $constructor = false ) Internally used to set the value of the property without any notification of changes nor state change.
addValue ( $value ) {@inheritDoc}
getBinary ( ) {@inheritDoc}
getBoolean ( ) {@inheritDoc}
getDate ( ) {@inheritDoc}
getDecimal ( ) {@inheritDoc}
getDefinition ( ) {@inheritDoc}
getDouble ( ) {@inheritDoc}
getIterator ( ) : Iterator Provide Traversable interface: redirect to getNodes with no filter
getLength ( ) {@inheritDoc}
getLong ( ) {@inheritDoc}
getNode ( ) {@inheritDoc}
getProperty ( ) {@inheritDoc}
getString ( ) {@inheritDoc}
getType ( ) {@inheritDoc}
getValue ( ) {@inheritDoc}
getValueForStorage ( ) Get the value of this property to store in the storage backend.
isMultiple ( ) {@inheritDoc}
remove ( ) Also unsets internal reference in containing node
setModified ( ) Tell this item that it has been modified.
setValue ( $value, $type = PropertyType::UNDEFINED ) {@inheritDoc}

Защищенные методы

Метод Описание
refresh ( $keepChanges, $internal = false ) Refresh this property

Приватные методы

Метод Описание
getReferencedNodes ( string[] $ids, boolean $weak ) : Node[] Get all nodes for $ids, ordered by that array, with duplicates if there are duplicates in $ids.

Описание методов

__construct() публичный Метод

To indicate a property has newly been created locally, make sure to pass true for the $new parameter. In that case, you should pass an empty array for $data and use setValue afterwards to let the type magic be handled. Then multivalue is determined on setValue For binary properties, the value is the length of the data(s), not the data itself.
public __construct ( jackalope\FactoryInterface $factory, array $data, string $path, jackalope\Session $session, ObjectManager $objectManager, boolean $new = false )
$factory jackalope\FactoryInterface the object factory
$data array array with fields type (integer or string from PropertyType) and value (data for creating the property value - array for multivalue property)
$path string the absolute path of this item
$session jackalope\Session the session instance
$objectManager ObjectManager the objectManager instance - the caller has to take care of registering this item with the object manager
$new boolean optional: set to true to make this property aware its not yet existing on the server. defaults to false

__destruct() публичный Метод

Close all open binary stream wrapper instances on shutdown.
public __destruct ( )

_setLength() публичный Метод

Internally used after refresh from backend to set new length
public _setLength ( integer $length )
$length integer the new length of this binary

_setValue() публичный Метод

Internally used to set the value of the property without any notification of changes nor state change.
См. также: Property::setValue()
public _setValue ( mixed $value, integer | string $type = PropertyType::UNDEFINED, boolean $constructor = false )
$value mixed The value to set.
$type integer | string PropertyType constant
$constructor boolean Whether this is called from the constructor.

addValue() публичный Метод

{@inheritDoc}
public addValue ( $value )

getBinary() публичный Метод

{@inheritDoc}
public getBinary ( )

getBoolean() публичный Метод

{@inheritDoc}
public getBoolean ( )

getDate() публичный Метод

{@inheritDoc}
public getDate ( )

getDecimal() публичный Метод

{@inheritDoc}
public getDecimal ( )

getDefinition() публичный Метод

{@inheritDoc}
public getDefinition ( )

getDouble() публичный Метод

{@inheritDoc}
public getDouble ( )

getIterator() публичный Метод

Provide Traversable interface: redirect to getNodes with no filter
public getIterator ( ) : Iterator
Результат Iterator over all child nodes

getLength() публичный Метод

{@inheritDoc}
public getLength ( )

getLong() публичный Метод

{@inheritDoc}
public getLong ( )

getNode() публичный Метод

{@inheritDoc}
public getNode ( )

getProperty() публичный Метод

{@inheritDoc}
public getProperty ( )

getString() публичный Метод

{@inheritDoc}
public getString ( )

getType() публичный Метод

{@inheritDoc}
public getType ( )

getValue() публичный Метод

{@inheritDoc}
public getValue ( )

getValueForStorage() публичный Метод

Path and reference properties are not resolved to the node objects. If this is a binary property, from the moment this method has been called the stream will be read from the transport layer again.
public getValueForStorage ( )

isMultiple() публичный Метод

{@inheritDoc}
public isMultiple ( )

refresh() защищенный Метод

{@inheritDoc} In Jackalope, this is also called internally to refresh when the node is accessed in state DIRTY. Triggers a reload of the containing node, as a property can only ever be loaded attached to a node. TODO: refactor this if we implement loading single properties
См. также: Item::checkState
protected refresh ( $keepChanges, $internal = false )

remove() публичный Метод

{@inheritDoc}
public remove ( )

setModified() публичный Метод

Used to make the parent node aware that this property has changed
public setModified ( )

setValue() публичный Метод

{@inheritDoc}
public setValue ( $value, $type = PropertyType::UNDEFINED )

Описание свойств

$definition защищенное свойство

cached instance of the property definition that defines this property
См. также: Property::getDefinition()
protected PropertyDefinitionInterface,PHPCR\NodeType $definition
Результат PHPCR\NodeType\PropertyDefinitionInterface

$isMultiple защищенное свойство

whether this is a multivalue property
protected bool $isMultiple
Результат boolean

$length защищенное свойство

length is only used for binary property, because binary loading is delayed until explicitly requested.
protected int $length
Результат integer

$streams защищенное свойство

All binary stream wrapper instances
protected array $streams
Результат array

$type защищенное свойство

the type constant from PropertyType
protected int $type
Результат integer

$value защищенное свойство

The property value in suitable native format or object
protected mixed $value
Результат mixed

$wrapBinaryStreams защищенное свойство

flag to know if binary streams should be wrapped or retrieved immediately. this is a per session setting.
См. также: Property::__construct()
protected bool $wrapBinaryStreams
Результат boolean