1 | <?php |
||
8 | class AttributeCollection extends Collection |
||
9 | { |
||
10 | /** |
||
11 | * Attribute Manager Instance |
||
12 | * |
||
13 | * @var |
||
14 | */ |
||
15 | protected $attributeManager; |
||
16 | |||
17 | /** |
||
18 | * The items contained in the collection. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $items = []; |
||
23 | |||
24 | /** |
||
25 | * Create a new collection. |
||
26 | * |
||
27 | * @param mixed $items |
||
28 | * |
||
29 | * @return void |
||
|
|||
30 | */ |
||
31 | public function __construct($items = []) |
||
42 | |||
43 | /** |
||
44 | * Attempt to reformat the current attribute items array |
||
45 | * into the most usable format (an Attribute Collection). |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | public function formatFields() |
||
62 | |||
63 | /** |
||
64 | * Allows adding fields to the Attribute Collection |
||
65 | * |
||
66 | * @param array $items |
||
67 | */ |
||
68 | public function add($items = []) |
||
76 | |||
77 | /** |
||
78 | * Format an Inner Field which can either be in the format |
||
79 | * of an Array, an instance of BaseAttribute or even an |
||
80 | * AttributeCollection object (which contains more!). |
||
81 | * |
||
82 | * @param mixed $name |
||
83 | * @param mixed $inner |
||
84 | * |
||
85 | * @return mixed |
||
86 | */ |
||
87 | protected function formatInnerField($name = null, $inner = []) |
||
117 | } |
||
118 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.