1 | <?php |
||
9 | class AttributeCollection extends Collection |
||
10 | { |
||
11 | /** |
||
12 | * The items contained in the collection. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $items = []; |
||
17 | |||
18 | /** |
||
19 | * Field Manager Instance |
||
20 | * |
||
21 | * @var \LaravelFlare\Fields\FieldManager |
||
22 | */ |
||
23 | protected $fields; |
||
24 | |||
25 | /** |
||
26 | * ModelAdmin which contains this Attribute Collection. |
||
27 | * |
||
28 | * @var \LaravelFlare\Flare\Admin\Models\ModelAdmin |
||
29 | */ |
||
30 | protected $modelManager; |
||
31 | |||
32 | /** |
||
33 | * Create a new collection. |
||
34 | * |
||
35 | * @param mixed $items |
||
36 | * |
||
37 | * @return void |
||
|
|||
38 | */ |
||
39 | public function __construct($items = [], $modelManager = null) |
||
47 | |||
48 | /** |
||
49 | * Attempt to reformat the current attribute items array |
||
50 | * into the most usable format (an Attribute Collection). |
||
51 | * |
||
52 | * @return void |
||
53 | */ |
||
54 | public function formatFields() |
||
67 | |||
68 | /** |
||
69 | * Allows adding fields to the Attribute Collection |
||
70 | * |
||
71 | * @param array $items |
||
72 | */ |
||
73 | public function add($items = []) |
||
81 | |||
82 | /** |
||
83 | * Format an Inner Field which can either be in the format |
||
84 | * of an Array, an instance of BaseAttribute or even an |
||
85 | * AttributeCollection object (which contains more!). |
||
86 | * |
||
87 | * @param mixed $name |
||
88 | * @param mixed $inner |
||
89 | * |
||
90 | * @return mixed |
||
91 | */ |
||
92 | protected function formatInnerField($name = null, $inner = []) |
||
128 | } |
||
129 |
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.