This class describes a Pedagogical Ressource

author bruno
package personalization
subpackage ksources

 Methods

Constructs a new PedagogicalRessource instance, from a url

__construct(string $url, $xml, boolean $abs) 

Parameters

$url

string

the url of the knowledge ressource

$xml

$abs

boolean

true if abstract ressource

Returns a string representation of the PedagogicalRessource: the class name and the url

__toString() : string

Returns

stringstring representation of the PedagogicalRessource

Add a descriptor and its value to the ressource

addDescriptor(\Descriptor $d, string $v) 

Parameters

$v

string

Returns the value for the descriptor if $d is a String, it represents the name of the descriptor

getDescriptorValue(\Descriptor | string $d) : string | null

Parameters

$d

\Descriptorstring

Returns

stringnullthe corresponding value

Returns the descriptors array

getDescriptors() : \Descriptor[] | null

Returns

\Descriptor[]nullthe array of descriptors for this ressource

Return the KSource url

getURL() : string
Inherited
inherited_from \KSource::getURL()

Returns

stringthe url

It is not yet possible to get internal ressources from a pedagogical ressource This function returns only the url of the SImpleXMLElement node of this ressource TODO: May be more complex in future

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

Parameters

$path

string

not used

$d

string

not used

Returns

\SimpleXMLElement\stingnullthe url

Returns the XML fragment representing this ressource as node

getXML() : \SimpleXMLElement

Returns

\SimpleXMLElementthe XML fragment representing this ressource as node

Return true if the ressource is abstract

isAbstract() : boolean

Returns

booleanthe value of $this->abstract

TODO: not done yet the argument should be a valid XPATH query

matchConstraint(string $c) : int
see \KSource::matchConstraint()

Parameters

$c

string

the constraint string

Returns

inta completion code, if 0: no matches, 1: match, other: error

 Properties

 

$abstract : boolean
 

$desc : \Descriptor

This array contains the descriptors used for the ressource.

For each descriptor, a corresponding value is stored in the values array at the same index

 

$url : \url
Inherited
inherited_from \KSource::$$url
 

$values : string[]

This array contains the values corresponding to the for the ressource descriptors.

see \PedagogicalRessource#desc
 

$xmlNode : \SimpleXMLElement