Delete a record by user ID

@param   integer  $id
@return  boolean
500048
public static function deleteXDomainUserId($id)
	{
		$db = \App::get('db');

		if (empty($id))
		{
			return false;
		}

		$id = intval($id);

		if ($id <= 0)
		{
			return false;
		}

		$query = 'DELETE FROM `#__xdomain_users` WHERE uidNumber=' . $db->quote($id) . ';';

		$db->setQuery($query);

		$db->query();

		return true;
	}
1367164
public function destroy($id)
    {
        // get user by id
        $user = AppUser::withTrashed()->where('id', $id)->first();

        if (!$user) {
            return response()->json(null, 404);
        }

        // delete user
        $deleteUser = $user->forceDelete();

        return response()->json(null, 204);
    }
756471
public static function delete($id)
    {
        DB::nonQuery('DELETE FROM `%s` WHERE `%s` = %u', [
            static::$tableName,
            static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'),
            $id,
        ], [static::class,'handleError']);

        return DB::affectedRows() > 0;
    }
1123486
public function delete($id = null)
    {
        if ($this->loaded() && !is_null($id) && ($id !== $this->id)) {
            throw $this->exception('Unable to determine which record to delete');
        }
        if (!is_null($id) && (!$this->loaded() || ($this->loaded() && $id !== $this->id))) {
            $this->load($id);
        }
        if (!$this->loaded()) {
            throw $this->exception('Unable to determine which record to delete');
        }
        $id = $this->id;

        $this->hook('beforeDelete', array($id));
        $this->controller->delete($this, $id);
        $this->hook('afterDelete', array($id));

        $this->unload();

        return $this;
    }
743251
public function delete($id = null) {
		$country = $this->Countries->get($id);

		if ($this->Countries->delete($country)) {
			$this->Flash->success(__('record del {0} done', $id));
			return $this->redirect(['action' => 'index']);
		}

		$this->Flash->error(__('record del {0} not done exception', $id));
		return $this->redirect(['action' => 'index']);
	}
854915
public function remove($id)
    {
        try {
            return $this->resource->delete([
                'index' => $this->schema->getName(),
                'type' => static::INDEX_TYPE,
                'id' => $id
            ]);
        } catch (NoNodesAvailableException $e) {
            return false;
        }
    }
1077787
public function deleteAction($id)
    {
        $delete = $this->getUserManager()->delete();
        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
1026359
public function delete($id)
    {
        try
        {
            $perm = $this->model->findOrFail($id);
            $oldData = $perm;
            $perm->delete();
            $this->event->fire('permissions.delete', array($oldData));

            return true;
        }
        catch ( ModelNotFoundException $e)
        {
            return false;
        }
    }
654604
public function delete($id)
    {
        $db = new DatabaseManager();
        $connection = $db->getDbh();

        $sql = 'DELETE from :table WHERE id=:id';
        $sql = str_replace(':table', $this->tableName, $sql);

        $statement = $connection->prepare($sql);
//        $statement->bindParam(':table',  $this->tableName);
        $statement->bindParam(':id', $id, \PDO::PARAM_INT);

        $queryWasSuccessful = $statement->execute();
        return $queryWasSuccessful;
    }
1023142
public function actionDelete($id)
    {
        $this->findModel($id)->updateAttributes(['status' => User::STATUS_DELETED]);

        return $this->redirect(['index']);
    }
1304160
public static function delete($id)
    {
        $db = new DatabaseManager();
        $connection = $db->getDbh();

        $statement = $connection->prepare('DELETE from ' . static::getTableName()  . ' WHERE id=:id');
        $statement->bindParam(':id', $id, \PDO::PARAM_INT);
        $queryWasSuccessful = $statement->execute();
        return $queryWasSuccessful;
    }
500841
public function destroy($id)
    {
        $return = false;

        $record = \Doctrine::getTable($this->_tableName)->find($id);
        if (false !== $record) {
            if ($record->delete()) {
                $return = true;
            }
        }

        return $return;
    }
1165740
public function delete($id)
    {
        $model = $this->model->where('id', $id)->first();
        if (!$model) {
            return false;
        }
        return $model->delete();
    }
160306
protected function deleteValue($id)
    {
        $file = $this->getFile($id);
        if (file_exists($file)) {
            return unlink($file);
        }
        return true;
    }
943581
public function delete(string $id)
    {
        $url = $this->url.'/'.$id;

        return $this->curl->delete($url);
    }
558326
public function remove($id)
    {
        $user = User::findOrNew($id);

        $user->delete();

        Alert::info(__('User was removed'));

        return redirect()->route('platform.systems.users');
    }
702514
public function delete($id)
	{
		$id = trim($this->escape($id));
		$hits = $this->getIndex()->find("xref_id:\"{$id}\"");
		if (empty($hits)) {
			return false;
		}
		
		foreach ($hits as $hit) {
			$this->getIndex()->delete($hit->id);
		}
		
		return true;
	}