1 | <?php |
||
26 | class TreeSelectStrategy implements StrategyInterface |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * The selected leafs. |
||
31 | * |
||
32 | * @var AbstractLeafs |
||
33 | */ |
||
34 | private $attachedLeafs; |
||
35 | |||
36 | /** |
||
37 | * The root node. |
||
38 | * |
||
39 | * @var NodeInterface |
||
40 | */ |
||
41 | private $treeRoot; |
||
42 | |||
43 | /** |
||
44 | * Flag wether multiple selections are allowed. |
||
45 | * |
||
46 | * @var bool|callable |
||
47 | */ |
||
48 | private $allowSelectMultipleItems = false; |
||
49 | |||
50 | private $shouldCreateLeafs = false; |
||
51 | |||
52 | /** |
||
53 | * Set the selected leafs. |
||
54 | * |
||
55 | * @param AbstractLeafs $attachedLeafs |
||
56 | * |
||
57 | * @return self |
||
58 | */ |
||
59 | public function setAttachedLeafs(AbstractLeafs $attachedLeafs) |
||
65 | |||
66 | /** |
||
67 | * Get the selected leafs. |
||
68 | * |
||
69 | * @return AbstractLeafs |
||
70 | */ |
||
71 | public function getAttachedLeafs() |
||
75 | |||
76 | /** |
||
77 | * Set the root node. |
||
78 | * |
||
79 | * @param NodeInterface $treeRoot |
||
80 | * |
||
81 | * @return self |
||
82 | */ |
||
83 | public function setTreeRoot(NodeInterface $treeRoot) |
||
89 | |||
90 | /** |
||
91 | * Get the root node. |
||
92 | * |
||
93 | * @return NodeInterface |
||
94 | */ |
||
95 | public function getTreeRoot() |
||
99 | |||
100 | /** |
||
101 | * Set the allow multiple selections flag. |
||
102 | * |
||
103 | * @param Callable|bool $flagOrCallback When a Callable is passed, it must return bool. |
||
104 | * |
||
105 | * @return self |
||
106 | */ |
||
107 | public function setAllowSelectMultipleItems($flagOrCallback) |
||
113 | |||
114 | /** |
||
115 | * Are multiple selections allowed? |
||
116 | * |
||
117 | * @return bool |
||
118 | */ |
||
119 | public function allowSelectMultipleItems() |
||
125 | |||
126 | public function setShouldCreateLeafs($flagOrCallback) |
||
132 | |||
133 | public function shouldCreateLeafs() |
||
139 | |||
140 | public function extract($value) |
||
167 | |||
168 | public function hydrate($value) |
||
191 | |||
192 | /** |
||
193 | * Find a leaf with a concrete value in the tree. |
||
194 | * |
||
195 | * @param NodeInterface $leaf |
||
196 | * @param string $value |
||
197 | * |
||
198 | * @return NodeInterface|null |
||
199 | */ |
||
200 | private function findLeaf(NodeInterface $leaf, $value) |
||
229 | } |
||
230 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.