1 | <?php |
||
12 | class Condition implements ConditionInterface |
||
13 | { |
||
14 | /** @var Argument[] Collection of condition arguments */ |
||
15 | public $arguments = array(); |
||
16 | |||
17 | /** @var string Relation logic between arguments */ |
||
18 | public $relation = ConditionInterface::CONJUNCTION; |
||
19 | |||
20 | /** |
||
21 | * Add condition argument to this condition group |
||
22 | * @param ArgumentInterface $argument Condition argument to be added |
||
23 | * @return self Chaining |
||
24 | */ |
||
25 | public function addArgument(ArgumentInterface $argument) |
||
32 | |||
33 | /** |
||
34 | * Add condition group to this condition group |
||
35 | * @param self $condition Condition group to be added |
||
36 | * @return self Chaining |
||
37 | */ |
||
38 | public function addCondition(ConditionInterface $condition) |
||
45 | |||
46 | /** |
||
47 | * Generic condition addiction function |
||
48 | * @param string $argument Entity for adding to arguments collection |
||
49 | * @param mixed $value Argument value |
||
50 | * @param string $relation Relation between argument and value |
||
51 | * @return self Chaining |
||
52 | */ |
||
53 | public function add($argument, $value, $relation = ArgumentInterface::EQUAL) |
||
62 | |||
63 | /** |
||
64 | * Constructor |
||
65 | * @param string $relation Relation type between arguments |
||
66 | */ |
||
67 | public function __construct($relation = null) |
||
71 | } |
||
72 |