This class represents a component (composante) in PMDLe A component is a child of a componentTree node or another component node

author bruno
package personalization
subpackage ksources

 Methods

add a Component in $components

addComponent(\Component $c) 

Parameters

$c

\Component

the component to be added

add a value in value and resort the value array with date as key

addValue(string $v, string $d) 

Parameters

$v

string

the value to add for ;-)

$d

string

the date of the value (key)

return the date of the evaluation at position i

getDate(int $i) : string

Parameters

$i

int

the index to read

Returns

stringthe date evaluation at index i in value

getter for name

getName() : string

Returns

stringthe value of name

getter for $subComponents

getSubComponents() : \(Component[] | \null)

Returns

\(Component[]\null)

return the last known value for key d if no key is specified, gives the last known value

getValue(string $d) : string | null

Parameters

$d

string

the date of the evaluation (key)

Returns

stringnullthe value of value or null if wrong date ;-)

This function resolves and return the value of the path Syntax: (component/).

getValueFromPath(string $path, string $d) : \(string | \null)

.. if $path is empty, returns the getValue($d) return value

todo faire des exceptions

Parameters

$path

string

path to a value in the component tree or empty to points the value of this component

$d

string

the date for the value. If not given, return the last evaluation value

Returns

\(string\null)the value corresponding to the path or null if invalid path, date or value

return the value array for evaluation

getValues() : array | null

Returns

arraynullthe value array

setter for name

setName(string $n) 

Parameters

$n

string

the value for name

 Properties

 

$name : string
 

$subComponent : \Component[]
 

$value : string[]