| @@ 169-180 (lines=12) @@ | ||
| 166 | * |
|
| 167 | * @return array |
|
| 168 | */ |
|
| 169 | protected function get() |
|
| 170 | { |
|
| 171 | if ($this->isLazyCollection) { |
|
| 172 | return LazyCollection::make(WooCommerce::all($this->endpoint, $this->options)); |
|
| 173 | } |
|
| 174 | ||
| 175 | if ($this->isCollection) { |
|
| 176 | return collect(WooCommerce::all($this->endpoint, $this->options)); |
|
| 177 | } |
|
| 178 | ||
| 179 | return WooCommerce::all($this->endpoint, $this->options); |
|
| 180 | } |
|
| 181 | ||
| 182 | /** |
|
| 183 | * Retrieve data. |
|
| @@ 388-401 (lines=14) @@ | ||
| 385 | * |
|
| 386 | * @return array |
|
| 387 | */ |
|
| 388 | public function save() |
|
| 389 | { |
|
| 390 | $this->results = WooCommerce::create($this->endpoint, $this->properties); |
|
| 391 | ||
| 392 | if ($this->isLazyCollection) { |
|
| 393 | return LazyCollection::make($this->results); |
|
| 394 | } |
|
| 395 | ||
| 396 | if ($this->isCollection) { |
|
| 397 | return collect($this->results); |
|
| 398 | } |
|
| 399 | ||
| 400 | return $this->results; |
|
| 401 | } |
|
| 402 | } |
|
| 403 | ||