PHP 클래스 Symfony\Component\Config\Definition\PrototypedArrayNode

저자: Johannes M. Schmitt ([email protected])
상속: extends Symfony\Component\Config\Definition\ArrayNode
파일 보기 프로젝트 열기: symfony/symfony 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$defaultChildren
$defaultValue
$keyAttribute
$minNumberOfElements
$prototype
$removeKeyAttribute

공개 메소드들

메소드 설명
addChild ( Symfony\Component\Config\Definition\NodeInterface $node ) Disable adding concrete children for prototyped nodes.
getDefaultValue ( ) : array Retrieves the default value.
getKeyAttribute ( ) : string Retrieves the name of the attribute which value should be used as key.
getPrototype ( ) : Symfony\Component\Config\Definition\PrototypeNodeInterface Retrieves the prototype.
hasDefaultValue ( ) : boolean Checks if the node has a default value.
setAddChildrenIfNoneSet ( integer | string | array | null $children = ['defaults'] ) Adds default children when none are set.
setDefaultValue ( string $value ) Sets the default value of this node.
setKeyAttribute ( string $attribute, boolean $remove = true ) Sets the attribute which value is to be used as key.
setMinNumberOfElements ( integer $number ) Sets the minimum number of elements that a prototype based node must contain. By default this is zero, meaning no elements.
setPrototype ( Symfony\Component\Config\Definition\PrototypeNodeInterface $node ) Sets the node prototype.

보호된 메소드들

메소드 설명
finalizeValue ( mixed $value ) : mixed Finalizes the value of this node.
mergeValues ( mixed $leftSide, mixed $rightSide ) : mixed Merges values together.
normalizeValue ( mixed $value ) : mixed Normalizes the value.

비공개 메소드들

메소드 설명
getPrototypeForChild ( string $key ) : mixed Returns a prototype for the child node that is associated to $key in the value array.

메소드 상세

addChild() 공개 메소드

Disable adding concrete children for prototyped nodes.
public addChild ( Symfony\Component\Config\Definition\NodeInterface $node )
$node Symfony\Component\Config\Definition\NodeInterface The child node to add

finalizeValue() 보호된 메소드

Finalizes the value of this node.
protected finalizeValue ( mixed $value ) : mixed
$value mixed
리턴 mixed The finalized value

getDefaultValue() 공개 메소드

The default value could be either explicited or derived from the prototype default value.
public getDefaultValue ( ) : array
리턴 array The default value

getKeyAttribute() 공개 메소드

Retrieves the name of the attribute which value should be used as key.
public getKeyAttribute ( ) : string
리턴 string The name of the attribute

getPrototype() 공개 메소드

Retrieves the prototype.
public getPrototype ( ) : Symfony\Component\Config\Definition\PrototypeNodeInterface
리턴 Symfony\Component\Config\Definition\PrototypeNodeInterface The prototype

hasDefaultValue() 공개 메소드

Checks if the node has a default value.
public hasDefaultValue ( ) : boolean
리턴 boolean

mergeValues() 보호된 메소드

Merges values together.
protected mergeValues ( mixed $leftSide, mixed $rightSide ) : mixed
$leftSide mixed The left side to merge
$rightSide mixed The right side to merge
리턴 mixed The merged values

normalizeValue() 보호된 메소드

Normalizes the value.
protected normalizeValue ( mixed $value ) : mixed
$value mixed The value to normalize
리턴 mixed The normalized value

setAddChildrenIfNoneSet() 공개 메소드

Adds default children when none are set.
public setAddChildrenIfNoneSet ( integer | string | array | null $children = ['defaults'] )
$children integer | string | array | null The number of children|The child name|The children names to be added

setDefaultValue() 공개 메소드

Sets the default value of this node.
public setDefaultValue ( string $value )
$value string

setKeyAttribute() 공개 메소드

This is useful when you have an indexed array that should be an associative array. You can select an item from within the array to be the key of the particular item. For example, if "id" is the "key", then: array( array('id' => 'my_name', 'foo' => 'bar'), ); becomes array( 'my_name' => array('foo' => 'bar'), ); If you'd like "'id' => 'my_name'" to still be present in the resulting array, then you can set the second argument of this method to false.
public setKeyAttribute ( string $attribute, boolean $remove = true )
$attribute string The name of the attribute which value is to be used as a key
$remove boolean Whether or not to remove the key

setMinNumberOfElements() 공개 메소드

Sets the minimum number of elements that a prototype based node must contain. By default this is zero, meaning no elements.
public setMinNumberOfElements ( integer $number )
$number integer

setPrototype() 공개 메소드

Sets the node prototype.
public setPrototype ( Symfony\Component\Config\Definition\PrototypeNodeInterface $node )
$node Symfony\Component\Config\Definition\PrototypeNodeInterface

프로퍼티 상세

$defaultChildren 보호되어 있는 프로퍼티

protected $defaultChildren

$defaultValue 보호되어 있는 프로퍼티

protected $defaultValue

$keyAttribute 보호되어 있는 프로퍼티

protected $keyAttribute

$minNumberOfElements 보호되어 있는 프로퍼티

protected $minNumberOfElements

$prototype 보호되어 있는 프로퍼티

protected $prototype

$removeKeyAttribute 보호되어 있는 프로퍼티

protected $removeKeyAttribute