1 | <?php namespace Algorit\Synchronizer; |
||
13 | class Loader { |
||
14 | |||
15 | use LoggerTrait; |
||
16 | |||
17 | /** |
||
18 | * The Company instance. |
||
19 | * |
||
20 | * @var object |
||
21 | */ |
||
22 | protected $company; |
||
23 | |||
24 | /** |
||
25 | * The Request instance. |
||
26 | * |
||
27 | * @var object |
||
28 | */ |
||
29 | protected $request; |
||
30 | |||
31 | /** |
||
32 | * The System instance. |
||
33 | * |
||
34 | * @var object |
||
35 | */ |
||
36 | protected $system; |
||
37 | |||
38 | /** |
||
39 | * The Builder instance. |
||
40 | * |
||
41 | * @var \Algorit\Synchronizer\Builder |
||
42 | */ |
||
43 | protected $builder; |
||
44 | |||
45 | /** |
||
46 | * The Container instance. |
||
47 | * |
||
48 | * @var \Algorit\Synchronizer\Container |
||
49 | */ |
||
50 | protected $container; |
||
51 | |||
52 | /** |
||
53 | * The Config instance. |
||
54 | * |
||
55 | * @var \Algorit\Synchronizer\Config |
||
56 | */ |
||
57 | public $config; |
||
58 | |||
59 | /** |
||
60 | * Create a new Loader. |
||
61 | * |
||
62 | * @param Builder $builder |
||
63 | * @param Config $config |
||
64 | * @return instance |
||
|
|||
65 | */ |
||
66 | public function __construct(Container $container, Builder $builder, Config $config) |
||
72 | |||
73 | /** |
||
74 | * Set the System instance |
||
75 | * |
||
76 | * @param \Algorit\Synchronizer\Request\Contracts\SystemInterface $system |
||
77 | * @return \Algorit\Synchronizer\Loader |
||
78 | */ |
||
79 | public function setSystem(SystemInterface $system) |
||
85 | |||
86 | /** |
||
87 | * Get the System instance |
||
88 | * |
||
89 | * @param void |
||
90 | * @return \Algorit\Synchronizer\System |
||
91 | */ |
||
92 | public function getSystem() |
||
96 | |||
97 | /** |
||
98 | * Get the Builder instance |
||
99 | * |
||
100 | * @param void |
||
101 | * @return \Algorit\Synchronizer\Builder |
||
102 | */ |
||
103 | public function getBuilder() |
||
107 | |||
108 | /** |
||
109 | * Get the System instance |
||
110 | * |
||
111 | * @param void |
||
112 | * @return \Algorit\Synchronizer\Request\Request |
||
113 | */ |
||
114 | public function getRequest() |
||
118 | |||
119 | /** |
||
120 | * Load the ERP Request. |
||
121 | * |
||
122 | * @param \Algorit\Synchronizer\Request\Contracts\SystemInterface $system |
||
123 | * @param mixed $callback |
||
124 | * @return \Algorit\Synchronizer\Loader |
||
125 | */ |
||
126 | public function loadSystem(SystemInterface $system, $callback = false) |
||
137 | |||
138 | /** |
||
139 | * Test if the variable is a collection or a resource. |
||
140 | * |
||
141 | * @param mixed $resource |
||
142 | * @param mixed $callback |
||
143 | * @return \Algorit\Synchronizer\Loader |
||
144 | */ |
||
145 | private function select($resource, $callback) |
||
164 | |||
165 | /** |
||
166 | * Start the loader given a Collection as resource. |
||
167 | * |
||
168 | * @param \Illuminate\Support\Collection $collection |
||
169 | * @param mixed $callback |
||
170 | * @return \Algorit\Synchronizer\Loader |
||
171 | */ |
||
172 | public function startCollection(Collection $collection, $callback = false) |
||
181 | |||
182 | /** |
||
183 | * Set the resource and start the builder. |
||
184 | * |
||
185 | * @param \Algorit\Synchronizer\Request\Contracts\ResourceInterface $resource |
||
186 | * @param mixed $callback |
||
187 | * @return \Algorit\Synchronizer\Loader |
||
188 | */ |
||
189 | public function start(ResourceInterface $resource, $callback = false) |
||
210 | |||
211 | } |
||
212 |
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.