Delete an existing model.

@throws \Exception

@return bool
325461
public function delete()
    {
        DB::beginTransaction();

        try {
            LaravelEvent::fire(static::$name.'.deleting', $this);
            $this->beforeDelete();
            $return = parent::delete();
            $this->afterDelete($return);
            LaravelEvent::fire(static::$name.'.deleted', $this);

            DB::commit();
        } catch (\Exception $e) {
            DB::rollBack();
            throw $e;
        }

        return $return;
    }
436055
public function delete()
    {
        $req = $this->deleteRequest();
        $retries = $this->config->connection_retries;
        $response = null;
        while (1) {
            try {
                $GLOBALS['logger']->info('Sending QingStor request: delete');
                $response = new Unpacker($this->config->client->send(
                    $req->sign()
                ));
                break;
            } catch (\Exception $e) {
                $GLOBALS['logger']->error($e->getMessage());
                if ($retries > 0) {
                    $retries -= 1;
                } else {
                    throw new \Exception('Network Error');
                }
            }
        }
        return $response;
    }
327954
public function delete()
    {
        $driveLocator = "/drives/{$this->parentReference->driveId}";
        $itemLocator  = "/items/{$this->id}";
        $endpoint     = "$driveLocator$itemLocator";

        $response = $this
            ->graph
            ->createRequest('DELETE', $endpoint)
            ->execute();

        $status = $response->getStatus();

        if ($status != 204) {
            throw new \Exception("Unexpected status code produced by 'DELETE $endpoint': $status");
        }
    }
1293433
public function dels($params)
    {
        if (empty($params))
        {
            throw new \Exception("Model dels params is empty!");
        }
    	$selectdb = new SelectDB($this->db);
        $selectdb->from($this->table);
		$selectdb->put($params);
        $selectdb->delete();
        return true;
    }
695734
public function delete(): bool
    {
        if ($this->isLeaf()) {
            return (bool)parent::delete();
        }

        return (bool)$this->objects()->filter([
            'lft__gte' => $this->lft,
            'rgt__lte' => $this->rgt,
            'root' => $this->root,
        ])->delete();
    }
1022714
public function delete()
    {
        if (is_null($this->getKeyName())) {
            throw new Exception('No primary key defined on model.');
        }

        // If the model doesn't exist, there is nothing to delete so we'll just return
        // immediately and not do anything else. Otherwise, we will continue with a
        // deletion process on the model, firing the proper events, and so forth.
        if (!$this->exists) {
            return;
        }

        if ($this->fireModelEvent('deleting') === false) {
            return false;
        }

        // Here, we'll touch the owning models, verifying these timestamps get updated
        // for the models. This will allow any caching to get broken on the parents
        // by the timestamp. Then we will go ahead and delete the model instance.
        $this->touchOwners();

        $this->performDeleteOnModel();

        $this->exists = false;

        // Once the model has been deleted, we will fire off the deleted event so that
        // the developers may hook into post-delete operations. We will then return
        // a boolean true as the delete is presumably successful on the database.
        $this->fireModelEvent('deleted', false);

        return true;
    }
1372122
public function delete()
    {
        self::$instance->reset();
        $this->sql('DELETE');
        $this->oosql_where = null;
        $numargs = func_num_args();

        if ($numargs > 0) {
            if ($numargs > 1) {
                $this->oosql_del_multiFlag = true;
                $this->oosql_del_numargs = $numargs;
            }
            $arg_list = func_get_args();
            if (is_array($arg_list[0])) {
                $this->sql(' FROM ' . $this->oosql_table);
                $this->where($arg_list[0][0] . ' = ?', $arg_list[0][1]);
                return $this;
            }
            $this->oosql_sql .= ' FROM';
            for ($i = 0; $i < $numargs; $i++) {
                if ($i != 0 && $numargs > 1) {
                    $this->sql(',');
                }
                $this->sql(' ' . $arg_list[$i]);
            }

        } else {
            $this->oosql_fromFlag = true;
        }


        return $this;
    }
537812
private function doDelete()
    {
        if (!$this->model->trashed()) {
            $this->model->delete();
            event(new ModelSoftDelete($this));

            return;
        }

        $this->model->forceDelete();
        event(new ModelDelete($this));
    }
724224
public function delete()
    {
        if (is_resource($this->handle)) {
            fclose($this->handle);
            $this->handle = null;
        }
        if ($this->exists()) {
            return unlink($this->path);
        }

        return false;
    }
272385
public function delete()
    {
        $this->exitIfModelNotSet();

        $params = [
            'id'    => $this->model->getKey(),
            'type'  => $this->model->getDocumentType(),
            'index' => $this->model->getDocumentIndex(),
        ];

        // check if the document exists before deleting
        if ($this->connection->existsStatement($params)) {
            return $this->connection->deleteStatement($params);
        }

        return true;
    }
73589
public function remove(Model $model = null)
    {
        if (func_num_args() === 0) {
            $this->connection->remove($this);
        } else {
            // avoid remove empty model
            if (is_null($model)) {
                throw new \Exception('[Norm/Collection] Cannot remove null model');
            }

            $this->applyHook('removing', $model);
            $result = $this->connection->remove($this, $model);

            if ($result) {
                $model->reset();
            }

            $this->applyHook('removed', $model);
        }
    }
537617
public function delete()
    {
        // call CommonMixin function
        $result = $this->sendDelete($this->handle, $this->api_key, $this->security);
        return $result;
    }
934115
protected function performDeleteOnModel()
    {
        if ($this->forceDeleting) {
            $this->exists = false;

            return $this->setKeysForSaveQuery($this->newModelQuery())->forceDelete();
        }

        return $this->runSoftDelete();
    }
1166385
public function delete()
    {
        if (!file_exists($this->path)) {
            throw new \Exception(
                "Can't delete something unexisting : " . $this->path,
                1
            );
        }

        if (is_dir($this->path)){
            $iterator = new \RecursiveIteratorIterator(
                new \RecursiveDirectoryIterator(
                    $this->path,
                    \RecursiveDirectoryIterator::SKIP_DOTS
                ),
                \RecursiveIteratorIterator::CHILD_FIRST
            );

            foreach ($iterator as $file) {
                if ($file->isDir()) {
                    rmdir($file->getPathname());
                    continue;
                }
                unlink($file->getPathname());
            }
            rmdir($this->path);
            return;
        }

        unlink($this->path);
    }
205839
public function delete($name) {
        if ($this->exists($name)) {
            foreach ($this->_fields as $i => $field) {
                if ($field->name === $name) {
                    unset($this->_fields[$i]);
                    break;
                }
            }
        } else throw new Exception("The '{$name}' field is not registered for this model.");
    }
830124
protected function doDelete()
    {
        $bindings = array_merge($this->bindings['join'], $this->bindings['where']);

        $query = 'DELETE'
            . $this->buildFrom()
            . $this->buildJoin()
            . $this->buildWhere();

        return $this->db->exec($query, $bindings);
    }
737894
public function delete()
    {
        $memoryTableAnnotation = ModelManager::getAnnotation($this, MemoryTable::class);
        if(null === $memoryTableAnnotation)
        {
            return null;
        }
        MemoryTableManager::del($memoryTableAnnotation->name, $this->__key);
    }