@@ 109-120 (lines=12) @@ | ||
106 | * |
|
107 | * @return object |
|
108 | */ |
|
109 | protected function update($id, $data) |
|
110 | { |
|
111 | if ($this->isLazyCollection) { |
|
112 | return LazyCollection::make(WooCommerce::update("{$this->endpoint}/{$id}", $data)); |
|
113 | } |
|
114 | ||
115 | if ($this->isCollection) { |
|
116 | return collect(WooCommerce::update("{$this->endpoint}/{$id}", $data)); |
|
117 | } |
|
118 | ||
119 | return WooCommerce::update("{$this->endpoint}/{$id}", $data); |
|
120 | } |
|
121 | ||
122 | /** |
|
123 | * Destroy Item. |
|
@@ 150-161 (lines=12) @@ | ||
147 | * |
|
148 | * @return object |
|
149 | */ |
|
150 | protected function batch($data) |
|
151 | { |
|
152 | if ($this->isLazyCollection) { |
|
153 | return LazyCollection::make(WooCommerce::create("{$this->endpoint}/batch", $data)); |
|
154 | } |
|
155 | ||
156 | if ($this->isCollection) { |
|
157 | return collect(WooCommerce::create("{$this->endpoint}/batch", $data)); |
|
158 | } |
|
159 | ||
160 | return WooCommerce::create("{$this->endpoint}/batch", $data); |
|
161 | } |
|
162 | ||
163 | /** |
|
164 | * Retrieve data. |