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