1 | <?php |
||
8 | abstract class AbstractCollectionBehavior |
||
9 | { |
||
10 | /** |
||
11 | * The property can be accessed through an addX method. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | const ADD = "add"; |
||
16 | |||
17 | /** |
||
18 | * The property can be accessed through a removeX method. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | const REMOVE = "remove"; |
||
23 | |||
24 | /** |
||
25 | * The name of an item in the collection. It is used to deduce the methods names. |
||
26 | * If it is not defined, it will be the singularized version of the property name. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $itemName; |
||
31 | |||
32 | /** |
||
33 | * The list of methods that can be used with the collection. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $methods; |
||
38 | |||
39 | /** |
||
40 | * The default methods that can be used. |
||
41 | * |
||
42 | * @var array<string> |
||
43 | */ |
||
44 | protected $defaultMethods; |
||
45 | |||
46 | /** |
||
47 | * Initializes the annotation. |
||
48 | * |
||
49 | * @param mixed $values The annotation's parameters. |
||
50 | */ |
||
51 | 6 | public function __construct($values) |
|
64 | |||
65 | /** |
||
66 | * Get the item name. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 6 | public function getItemName() |
|
74 | |||
75 | /** |
||
76 | * Get the list of methods that can be used. |
||
77 | * |
||
78 | * @return array<string> |
||
79 | */ |
||
80 | 6 | public function getMethods() |
|
84 | } |
||
85 |