1: <?php
2: /**
3: * PHP version 5
4: * @package generalDriver
5: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
6: * @author Stefan Heimes <stefan_heimes@hotmail.com>
7: * @author Tristan Lins <tristan.lins@bit3.de>
8: * @copyright The MetaModels team.
9: * @license LGPL.
10: * @filesource
11: */
12:
13: namespace DcGeneral\DataDefinition;
14:
15: /**
16: * A condition define when a property is visible or editable and when not.
17: */
18: interface ConditionChainInterface extends ConditionInterface
19: {
20: /**
21: * All conditions must match.
22: */
23: const AND_CONJUNCTION = 'AND';
24:
25: /**
26: * Only one condition must match.
27: */
28: const OR_CONJUNCTION = 'OR';
29:
30: /**
31: * Clear the chain.
32: *
33: * @return ConditionChainInterface
34: */
35: public function clearConditions();
36:
37: /**
38: * Set the conditions in this chain.
39: *
40: * @param array|ConditionInterface[] $conditions The conditions.
41: *
42: * @return ConditionChainInterface
43: */
44: public function setConditions(array $conditions);
45:
46: /**
47: * Add multiple conditions to this chain.
48: *
49: * @param array|ConditionInterface[] $conditions The conditions.
50: *
51: * @return ConditionChainInterface
52: */
53: public function addConditions(array $conditions);
54:
55: /**
56: * Add a condition to this chain.
57: *
58: * @param ConditionInterface $condition The condition.
59: *
60: * @return ConditionChainInterface
61: */
62: public function addCondition(ConditionInterface $condition);
63:
64: /**
65: * Remove a condition from this chain.
66: *
67: * @param ConditionInterface $condition The condition.
68: *
69: * @return ConditionChainInterface
70: */
71: public function removeCondition(ConditionInterface $condition);
72:
73: /**
74: * Retrieve the conditions contained in the chain.
75: *
76: * @return ConditionInterface[]
77: */
78: public function getConditions();
79:
80: /**
81: * Set the conjunction.
82: *
83: * @param string $conjunction The conjunction.
84: *
85: * @return ConditionChainInterface
86: */
87: public function setConjunction($conjunction);
88:
89: /**
90: * Retrieve the conjunction.
91: *
92: * @return string
93: */
94: public function getConjunction();
95: }
96: