Explicitly delete the cursor

This might issue an HTTP DELETE request to inform the server about
the deletion.

@throws Exception
@return bool - true if the server acknowledged the deletion request, false otherwise
977337
public function delete()
    {
        if ($this->_id) {
            try {
                $this->_connection->delete($this->url() . '/' . $this->_id, []);

                return true;
            } catch (Exception $e) {
            }
        }

        return false;
    }
739546
public function remove()
    {
        $mPrimaryKeyName = $this->_mPrimaryKeyName;
        $bInsertMode = false;

        if ($mPrimaryKeyName === false) {

            throw new Exception('['.__FILE__.' (l.'.__LINE__.'] no primary key on this table!');
        }
        else if (is_string($mPrimaryKeyName)) {

            $sMethodPrimaryKey = 'get_'.$this->_mPrimaryKeyNameWithoutMapping;
            $aPrimaryKey = array($mPrimaryKeyName => $this->$sMethodPrimaryKey());
        }
        else {

            $aPrimaryKey = array();

            foreach($mPrimaryKeyName as $sKey => $sPrimaryKey) {

                $sMethodPrimaryKey = 'get_'.$this->_mPrimaryKeyNameWithoutMapping[$sKey];
                $aPrimaryKey[$sPrimaryKey] = $this->$sMethodPrimaryKey();
            }
        }

        /**
         * check if the virtual foreign key in this model is respected
         */
        if (count($this->_aForeignKey) > 0) {

            foreach ($this->_aForeignKey as $sName => $aForeignKey) {

                if ($aForeignKey['has_one'] == 1 && isset($aForeignKey['foreign_key_options']['action'])
                    && $aForeignKey['foreign_key_options']['action'] == self::CASCADE) {

                    $sMethodPrimaryKey = 'get_'.$aForeignKey['foreign_key'];
                    $mFIeld = $this->$sMethodPrimaryKey();

                    if ($mFIeld) {

                        $oOrm = new Orm;

                        $iResults = $oOrm->select(array('*'))
                            ->from($aForeignKey['entity_join_name']);

                        $oWhere = new Where;

                        $oWhere->whereEqual($aForeignKey['primary_key_name'], $mFIeld);

                        $aResults = $oOrm->where($oWhere)
                            ->load();

                        if (count($aResults) > 0) {

                            $oOrm = new Orm;

                            $oOrm->delete($aForeignKey['entity_join_name'])
                                ->where($oWhere)
                                ->save();
                        }
                    }
                }
            }
        }

        $oOrm = new Orm;

        $oOrm->delete(preg_replace('/^.*\\\\([a-zA-Z0-9_]+)$/', '$1', get_called_class()))
            ->where($aPrimaryKey)
            ->save();

        return $this;
    }
970683
public function delete() {
        $query = $this->getPrimaryKeyQuery();
        if (empty($query)) {
            return false;
        }
        $row = $query->delete();
        if (!empty($row)) {
            $this->initOldAttribute();
        }
        return $row;
    }
550265
public function disconnect() {
        if ($this->socket) {
            if (!fclose($this->socket)) {
                throw new \Exception("Error while closing telnet socket");
            }
            $this->socket = NULL;
        }
        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;
    }
1190333
public function deleteByUuid()
    {
        if (is_null($this->getUuidKeyName())) {
            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->performDeleteOnModelByUuid();

        // 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;
    }
651373
public function remove()
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            $clearCache = false;
            if ($this->sender_status == self::STATUS_NEW) {
                $clearCache = true;
            }
            $this->scenario = 'remove';
            if (empty($this->messageReceivers)) {
                if (!$this->delete()) {
                    throw new Exception('Message removing error!');
                }
                if ($clearCache) {
                    Podium::getInstance()->podiumCache->deleteElement('user.newmessages', $this->sender_id);
                }
                $transaction->commit();
                return true;
            }
            $allDeleted = true;
            foreach ($this->messageReceivers as $mr) {
                if ($mr->receiver_status != MessageReceiver::STATUS_DELETED) {
                    $allDeleted = false;
                    break;
                }
            }
            if ($allDeleted) {
                foreach ($this->messageReceivers as $mr) {
                    if (!$mr->delete()) {
                        throw new Exception('Received message removing error!');
                    }
                }
                if (!$this->delete()) {
                    throw new Exception('Message removing error!');
                }
                if ($clearCache) {
                    Podium::getInstance()->podiumCache->deleteElement('user.newmessages', $this->sender_id);
                }
                $transaction->commit();
                return true;
            }
            $this->sender_status = self::STATUS_DELETED;
            if (!$this->save()) {
                throw new Exception('Message status changing error!');
            }
            if ($clearCache) {
                Podium::getInstance()->podiumCache->deleteElement('user.newmessages', $this->sender_id);
            }
            $transaction->commit();
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), $this->id, __METHOD__);
        }
        return false;
    }
1040453
public function delete()
	{
		//build the delete query string
		$sql = $this->buildDelete();

		//set the value of the query_string
		$this->responseObject->setQueryString($sql);

		//time query execution
		$query_start_time = microtime(true);

		//execute the query string
		$result = $this->connector->execute($sql);

		$query_stop_time = microtime(true);
		$query_excec_time = $query_stop_time - $query_start_time;
		$this->responseObject->setQueryTime($query_excec_time);

		//put this in try...catch block for better error handling
		try{

			//throw error if there was an error perfrorming this query
			if ( $result === false ) 
			{
				//throw excepton
				throw new MySQLException(get_class(new MySQLException) . ' ' .$this->connector->lastError() . '<span class="query-string"> (' . $sql . ') </span>');
				
			}
			
		}

		//diplay error message
		catch(MySQLException $MySQLExceptionObject){

			//display error message
			$MySQLExceptionObject->errorShow();

		}


		//if delete was successfull, get and return the number of affected rows
		$this->responseObject
			->setAffectedRows($this->connector->affectedRows());

		return $this->responseObject;

	}
741246
protected function _exception() {
        $url = '.' . $this->request->src . '.' . $this->request->controller . '.' . $this->request->action;

        if (in_array($url, $this->config['user']['security']['spam']['config']['exception'])) {
            $this->_exception = true;
        }

        return $this->_exception;
    }
43057
public function delete() {
		if ($this->dbId()) {
			$this->db()->query('DELETE FROM `'.$this->table().'` WHERE `'.$this->idVar().'` = ?', [$this->dbId()]);
		} else {
			throw new Exception('Cannot delete. No ID was given.');
		}
		return $this;
	}
941922
public function delete()
    {
        // convert to condition.
        $args = func_get_args();
        $cond = call_user_func_array(array($this, 'toCondition'), $args);

        // to SQL.
        $sql = $cond->toDeleteSQL();
        var_dump($sql, $cond->getParams());

        // query.
        $sth = $this->query($sql, $cond->getParams());
        return $sth->isSuccess();
    }
966868
public function delete()
    {
        $list = StorageLocation::getList();
        foreach ($list as $item) {
            if ($item->getTypeObject()->getHandle() == $this->getHandle()) {
                throw new \Exception(t('Please remove all storage locations using this storage type.'));
            }
        }

        $em = \ORM::entityManager();
        $em->remove($this);
        $em->flush();

        return true;
    }
45910
public function podiumDelete()
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            if (!Podium::getInstance()->db->createCommand()->delete('{{%podium_poll_vote}}', ['poll_id' => $this->id])->execute()) {
                throw new Exception('Poll Votes deleting error!');
            }
            if (!PollAnswer::deleteAll(['poll_id' => $this->id])) {
                throw new Exception('Poll Answers deleting error!');
            }
            if (!$this->delete()) {
                throw new Exception('Poll deleting error!');
            }
            $transaction->commit();
            Log::info('Poll deleted', !empty($this->id) ? $this->id : '', __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
425848
public function delete(){

        $query= /** @lang text */
            'DELETE FROM '.self::sanitize(static::$table);


        if (!empty($this->whereby)) {

            $query = $query . ' WHERE ' . $this->whereby;
        }

        try {
            $this->exec($query);

            static::$response["status"] = "success";
            static::$response["response"] = 'success';
            static::$response['code'] = 200;
            return static::terminate(static::$response);
        } catch (Exception $e) {
            static::$response["status"] = "error";
            static::$response["response"] = $e->getMessage();
            static::$response['code'] = $e->getCode();
            return static::terminate(static::$response);
        }
    }
1135192
public function delete($collection = '')
		{
			if (empty($collection)) {
				throw new Exception("No Mongo collection selected to delete from");
			}

			try
			{
				$this->db->{$collection}->remove($this->wheres, array('fsync' => true, 'justOne' => true));

				$this->_clear();

				return true;
			} catch (\MongoCursorException $e) {
				throw new Exception("Delete of data into MongoDB failed: {$e->getMessage()}", $e->getCode());
			}
		}
508038
public function closeCursor()
	{
		if($this->isFetched == false)
		{
			throw new LikePDOException("There is no fetch statement");
			return false;
		}
		else
		{
			do
			{
				while($this->fetch());
					
				if(!$this->nextRowset())
					break;
					
			} while(true);
			
			return true;
		}
	}
24434
public function delete()
    {
        // Validate form
        $form = $this->getForm('Delete' . $this->getEntityName());
        if (!$form->isValid()) {
            $this->addMessage($form->getMessages(), FlashMessenger::NAMESPACE_ERROR);
            return false;
        }

        // Remove account entity
        $entity = $form->getData();
        $this->getEntityManager()->remove($entity);

        // Trigger ondelete
        $this->onDelete($entity);

        // Save
        return $this->save($this->getEntityName() . ' deleted.', 'Unable to delete ' . strtolower($this->getEntityName()) . '.');
    }