This class represents a Rule of personnalisation It includes the mechanism to apply the rule

author bruno
package personalization
subpackage rules

 Methods

Constructs a new Rule instance, with a premice and a consequence

__construct(\Premice $p, \Consequence $c) 

Parameters

$p

\Premice

the premice instance

$c

\Consequence

the Consequence instance

Analyze the syntax of the rule and returns a code: <ul> <li>0: rule is valid</li> <li>100: missing premice part</li> <li>200: missing consequence part</li> <li>1000: premice part not valid</li> <li>2000: consequence part not valid</li> </ul> TODO building a complete documentation of error codes

analyze() : int

Returns

intreturn code for analysis

Apply the rule on the Knowledge sources collection

apply(\KSource $ks) : null | \KSource[][]

Parameters

$ks

\KSource

Returns

null\KSource[][]the modified collection of KSource, or null if rule is not valid or filtered every KSource; index 0 contains profile, index 1 contains graphs

 Properties

 

$cons : \Consequence
 

$premice : \Premice