@@ 47-58 (lines=12) @@ | ||
44 | * |
|
45 | * @return array |
|
46 | */ |
|
47 | protected function all($options = []) |
|
48 | { |
|
49 | if ($this->isLazyCollection) { |
|
50 | return LazyCollection::make(WooCommerce::all($this->endpoint, $options)); |
|
51 | } |
|
52 | ||
53 | if ($this->isCollection) { |
|
54 | return collect(WooCommerce::all($this->endpoint, $options)); |
|
55 | } |
|
56 | ||
57 | return WooCommerce::all($this->endpoint, $options); |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * Retrieve single Item. |
|
@@ 88-99 (lines=12) @@ | ||
85 | * |
|
86 | * @return object |
|
87 | */ |
|
88 | protected function create($data) |
|
89 | { |
|
90 | if ($this->isLazyCollection) { |
|
91 | return LazyCollection::make(WooCommerce::create($this->endpoint, $data)); |
|
92 | } |
|
93 | ||
94 | if ($this->isCollection) { |
|
95 | return collect(WooCommerce::create($this->endpoint, $data)); |
|
96 | } |
|
97 | ||
98 | return WooCommerce::create($this->endpoint, $data); |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * Update Existing Item. |