Destroy the model for the given ID.

@param  int  $ids
@return bool
350671
public static function destroy($id)
    {
        $instance = new static;

        // We will actually get the models from the API and call delete on it.
        // This way its events get fired properly with a correct set of attributes
        // in case the developers wants to check these.
        $key   = $instance->getKeyName();
        $model = $instance->where($key, $id)->first();

        if ($model->delete()) {
            return true;
        }

        return false;
    }
1239410
def delete_by_ids(self, ids):
        
        try:
            self.filter(id__in=ids).delete()
            return True
        except self.model.DoesNotExist:
            return False
618062
public function detach($ids = [])
    {
        if ($ids instanceof EntityCollection) {
            $ids = (array) $ids->modelKeys();
        }

        $query = $this->newPivotQuery();

        // If associated IDs were passed to the method we will only delete those
        // associations, otherwise all of the association ties will be broken.
        // We'll return the numbers of affected rows when we do the deletes.
        $ids = (array) $ids;

        if (count($ids) > 0) {
            $query->whereIn($this->otherKey, (array) $ids);
        }

        // Once we have all of the conditions set on the statement, we are ready
        // to run the delete on the pivot table. Then, if the touch parameter
        // is true, we will go ahead and touch all related models to sync.
        return $query->delete();
    }
1247291
public function destroySession ($id) {
        $this->_connection->getClient ()->delete ($this->calculateKey ($id));
        return true;
    }
547081
public function deletePermissions(array $ids): void
	{
		if ($this->isAjax()) {
			$permissions = $this->orm->acl->findById($ids);
			foreach ($permissions as $permission) {
				$this->orm->acl->remove($permission);
			}
			$this->orm->flush();
			$this['permissionsList']->reload();
		} else {
			$this->terminate();
		}
	}
1258109
public function deleteMany($ids = null)
    {
        if (is_null($ids)) {
            $parameters = [
                'performAll' => true
            ];
        } else {
            $parameters = [
                'ids' => implode(',', (array) $ids),
            ];
        }

        $response = $this->ontraport->delete(
            $this->getNamespace(), $this->toArray($parameters)
        );

        // When deleting many objects, we get a string for the data field in the response,
        // saying "Deleted". When an object does not exist, it is ignored by oap. I believe
        // its safe to assume that we can always return successfuly here. Unless we receive
        // a non 200 status code in which case an InvalidRequest would be thrown.

        return true;
    }
1199922
public function remove($ids = [])
    {
        if (!is_array($ids)) {
            $ids = [$ids];
        }

        $result = $this->request(
            'POST',
            $this->getCore() . '/update/json',
            [],
            [
                'delete' => $ids
            ]
        );

        if ($this->isAutoCommit()) {
            $this->commit();
        }

        return $result;
    }
421058
public function deleteMessages($ids)
    {
        foreach ($ids as $id) {
            imap_delete($this->imap, $id, FT_UID);
        };
        return imap_expunge($this->imap);
    }
388658
public function deleteIds(array $ids, $routing = false)
    {
        return $this->getIndex()->getClient()->deleteIds($ids, $this->getIndex(), $this, $routing);
    }
1180431
public function destroy($id)
    {
        $request = $this->makeRequest('destroy');
        $deleted = $this->service->destroy($id);
        return $this->maybeMakeResource('delete', $deleted);

    }
593719
protected function disassociateEveryone(array $ids)
    {
        $query = Models::query('permissions')
            ->whereNull('entity_id')
            ->where($this->constraints())
            ->whereIn('ability_id', $ids);

        Models::scope()->applyToRelationQuery($query, $query->from);

        $query->delete();
    }
1113571
public static function destroy($id) {
        $model = get_called_class();
        /* @var $model Record */
        $model = new $model;
        $pk = $model->getPkField();
        $model->$pk = $id;
        $model->delete();
    }
1151552
final public function deleteByPks(array $ids)
    {
        foreach ($ids as $id) {
            if (!$this->deleteByPk($id)) {
                return false;
            }
        }

        return true;
    }
1226819
public function destroy($id)
    {
        $sql = 'DELETE FROM ' . $this->config['name'] . ' WHERE ' . $this->config['primary'] . ' = ?';

        $this->query($sql, array($id));

        return true;
    }
971454
public function destroy($id)
    {
        if ($this->model->deleteEnv($id)) {
            $data = [
                'status' => true,
                'message' => trans('admin.delete_succeeded'),
            ];
        } else {

            $data = [
                'status' => false,
                'message' => trans('admin.delete_failed'),
            ];
        }

        return response()->json($data);
    }
193380
public function destroySession($id)
    {
        $this->db->getCollection($this->sessionCollection)->remove(
            ['id' => $id],
            ['justOne' => true]
        );

        return true;
    }
300490
public function deleteUsers(array $ids): void
	{
		if ($this->isAjax()) {
			$users = $this->orm->users->findById($ids);
			foreach ($users as $user) {
				$this->orm->users->remove($user);
			}
			$this->orm->flush();
			$this['userList']->reload();
		} else {
			$this->terminate();
		}
	}