Deletes a poll.

@param Poll $poll
@return bool
@throws \Exception
964389
public function deletePoll(Poll $poll): bool
    {
        if (empty($poll->getAdminKey())) {
            throw new \Exception(sprintf('Admin key not available. Poll %s cannot be deleted.', $poll->getId()), 1443782170);
        }
        return $this->doDelete('/api/v2.0/polls/' . $poll->getId() . '?adminKey=' . $poll->getAdminKey());
    }
1256455
public function delete()
    {
        if ($this->deleteStatement == null) {
            $this->deleteStatement = $this->connection->prepare("DELETE FROM User WHERE username = ?");
            $this->deleteStatement->bindParam(1, $this->username);
        }
        try{
            $this->deleteStatement->execute();
        } catch (PDOException $exception){
            return false;
        }
        if ($this->exists()) {
            return false;
        }
        $this->notifyObservers(User::EVENT_DELETE);
        return true;
    }
447047
public function delete()
	{
		if (!isset($this->name) && !isset($this->id))
		{
			return false;
		}

		$db = \App::get('db');

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

		if (!isset($this->id))
		{
			$db->setQuery("SELECT id FROM `#__trac_project` WHERE name=" . $db->quote($this->name) . ";");

			$this->id = $db->loadResult();
		}

		if (empty($this->id))
		{
			return false;
		}

		$db->setQuery("DELETE FROM `#__trac_project` WHERE id=" . $db->quote($this->id) . ";");

		if (!$db->query())
		{
			return false;
		}

		$db->setQuery("DELETE FROM `#__trac_user_permission` WHERE trac_project_id=" . $db->quote($this->id) . ";");
		$db->query();
		$db->setQuery("DELETE FROM `#__trac_group_permission` WHERE trac_project_id=" . $db->quote($this->id) . ";");
		$db->query();

		return true;
	}
183369
public function removeSurvey(\Lyon1\Bundle\PoobleBundle\Entity\Survey $survey)
    {
        $this->surveys->removeElement($survey);
    }
1285503
function remove_thread($mailbox = null)
    {
        $this->db->query(
            "DELETE FROM {$this->thread_table}"
            ." WHERE `user_id` = ?"
                .(strlen($mailbox) ? " AND `mailbox` = ".$this->db->quote($mailbox) : ""),
            $this->userid
        );

        if (strlen($mailbox)) {
            unset($this->icache[$mailbox]['thread']);
            // Thread data removed, set flag to skip SELECT query in get_thread()
            $this->icache[$mailbox]['thread_queried'] = true;
        }
        else {
            $this->icache = array();
        }
    }
1163370
public function delete()
    {
        $return = false;
        if (isset($this->tokenId)) {
            $return = $this->apiCall->delete(
                $this->endpoint.'/delete',
                array('tokenId'=>$this->tokenId)
            );
        }
        return $return;
    }
700708
protected function _delete($query)
    {
        $db = $this->db;
        $sth = $db->prepare($query);
        $response = $sth->execute();

        if ($response) {
            return true;
        }

        return false;
    }
437740
public function delete($key)
    {
        $key = $this->_key($key);
        unset($this->data[$key]);

        return true;
    }
165593
public function delete(User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_DELETE);

        try {
            ($trashed = $user->trashed()) ? $user->forceDelete() : $user->delete();

            $message = $this->transNotification(
                $trashed ? 'deleted' : 'trashed',
                ['name' => $user->full_name],
                $user->toArray()
            );

            return $this->jsonResponseSuccess(compact('message'));
        }
        catch(\Exception $e) {
            return $this->jsonResponseError(['message' => $e->getMessage()], 500);
        }
    }
48475
public function poll()
    {
        try {
            foreach ($this->getMonitoredQueues() as $queue) {
                $this->storeTubeStats($queue);
                $this->deploySonar($queue);

                if (! $this->isQueueOnline($queue)) {
                    continue;
                }

                if (! $this->isWaitTimeOk($queue)) {
                    continue;
                }

                if (! $this->isPendingCountOk($queue)) {
                    continue;
                }

                if (! $this->isFailedCountOk($queue)) {
                    continue;
                }
            }
        } catch (Exception $e) {
            $this->eye->logger()->error('Error during queue poll process', $e);
        }
    }
632588
public function delete($id) {
        $params = $this->parseUrl($id);

        try {
            $this->getClient()->deleteObject(array(
                'Bucket' => $params['bucket'],
                'Key' => $params['key']
            ));
        } catch (S3Exception $e) {
            return false;
        }

        return true;
    }
953540
public function delete($key)
    {
        $permission   =   $this->findByKey($key);
        if (! isset($permission)) {
            return true;
        }

        return $permission->delete();
    }
42736
public function deleteToken($token)
    {
        $tokenObject = $this->findToken($token);

        if ($tokenObject == null) {
            return (false);
        }
        $this->call($this->tyrUrl . '/' . $this->version . '/users/' . $this->user->id . '/keys/' . $tokenObject->id .'/', 'DELETE');
        return true;
    }
931392
public function delete(Post $post)
    {
        $response = $this->api->process(new DeletePost($post));
        if ($response->getStatusCode() == 200) {
            return true;
        } else {
            return false;
        }
    }
742260
public function delete($project, $user, $optParams = array())
  {
    $params = array('project' => $project, 'user' => $user);
    $params = array_merge($params, $optParams);
    return $this->call('delete', array($params), "Computeaccounts_Operation");
  }
735710
public function delete($documentId, $rev)
    {
        $context = array('http' => array());
        $context['http']['method'] = 'DELETE';

        list($status, $response) = $this->sendRequest($documentId . '?rev=' . $rev, $context);
        unset($response);

        if ($status != 200) {
            throw new Exception\Response('DELETE - Unknown response status.');
        }

        if ($this->getCache($documentId)) {
            unset($this->cache[$documentId]);
        }

        return true;
    }
1271736
public function delete()
	{
		if ($this->user_id <= 0)
		{
			return false;
		}

		$db = \App::get('db');

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

		if (!isset($this->user_id))
		{
			$db->setQuery("SELECT user_id FROM `#__users_password` WHERE user_id" . $db->quote($this->user_id) . ";");

			$this->__set('user_id', $db->loadResult());
		}

		if (empty($this->user_id))
		{
			return false;
		}

		$db->setQuery("DELETE FROM `#__users_password` WHERE user_id= " . $db->quote($this->user_id) . ";");

		$affected = 0;

		if ($db->query())
		{
			$affected = $db->getAffectedRows();
		}

		if ($affected > 0)
		{
			\Event::trigger('user.onAfterDeletePassword', array($this));
		}

		return true;
	}