| @@ 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 | ||
| @@ 168-179 (lines=12) @@ | ||
| 165 | * |
|
| 166 | * @return array |
|
| 167 | */ |
|
| 168 | protected function get() |
|
| 169 | { |
|
| 170 | if ($this->isLazyCollection) { |
|
| 171 | return LazyCollection::make(WooCommerce::all($this->endpoint, $this->options)); |
|
| 172 | } |
|
| 173 | ||
| 174 | if ($this->isCollection) { |
|
| 175 | return collect(WooCommerce::all($this->endpoint, $this->options)); |
|
| 176 | } |
|
| 177 | ||
| 178 | return WooCommerce::all($this->endpoint, $this->options); |
|
| 179 | } |
|
| 180 | ||
| 181 | /** |
|
| 182 | * Retrieve data. |
|