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
파일 보기 프로젝트 열기: jackalope/jackalope 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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