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 | * ModelAdmin which contains this Attribute Collection. |
||
26 | * |
||
27 | * @var \LaravelFlare\Flare\Admin\Models\ModelAdmin |
||
28 | */ |
||
29 | protected $modelManager; |
||
30 | |||
31 | /** |
||
32 | * Create a new collection. |
||
33 | * |
||
34 | * @param mixed $items |
||
35 | * |
||
36 | * @return void |
||
|
|||
37 | */ |
||
38 | public function __construct($items = [], $modelManager = null) |
||
46 | |||
47 | /** |
||
48 | * Attempt to reformat the current attribute items array |
||
49 | * into the most usable format (an Attribute Collection). |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function formatFields() |
||
66 | |||
67 | /** |
||
68 | * Allows adding fields to the Attribute Collection |
||
69 | * |
||
70 | * @param array $items |
||
71 | */ |
||
72 | public function add($items = []) |
||
80 | |||
81 | /** |
||
82 | * Format an Inner Field which can either be in the format |
||
83 | * of an Array, an instance of BaseAttribute or even an |
||
84 | * AttributeCollection object (which contains more!). |
||
85 | * |
||
86 | * @param mixed $name |
||
87 | * @param mixed $inner |
||
88 | * |
||
89 | * @return mixed |
||
90 | */ |
||
91 | protected function formatInnerField($name = null, $inner = []) |
||
127 | } |
||
128 |
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.