예제 #1
0
 /**
  * Perform the actual delete query on this model instance.
  *
  * @return void
  */
 protected function performDeleteOnModel()
 {
     if ($this->selfUrl) {
         self::$client->delete($this->selfUrl);
     } else {
         $this->setKeysForSaveQuery($this->newQuery())->delete();
     }
 }
예제 #2
0
 public function delete($id = null)
 {
     if (!is_null($id)) {
         $this->where('id', 'eq', $id);
     }
     $chunkSize = 50;
     $this->chunk($chunkSize, function ($rows) {
         foreach ($rows as $existing) {
             $url = $existing->{'@controls'}->self->href;
             $this->client->delete($url, []);
         }
     });
     return true;
 }