Deletes related properties from database
@return bool
966504
public function beforeDelete()
    {
        // properties assigned to this record
        /** @var \yii\db\ActiveRecord|\DevGroup\DataStructure\traits\PropertiesTrait $owner */
        $owner = $this->owner;
        $event = new HasPropertiesEvent();
        $event->model = $owner;
        HasPropertiesEvent::trigger(self::class, self::EVENT_BEFORE_DELETE, $event);
        //! @todo add check if this object doesn't has related properties that we wish to delete(lower db queries)
        $array = [&$owner];
        PropertiesHelper::deleteAllProperties($array);
        unset($array);

        return true;
    }
723139
public function delete() {
        global $DB;

        if (empty($this->id)) {
            debugging('Can not delete data object, no id!');
            return false;
        }

        $data = $this->get_record_data();

        if ($DB->delete_records($this->table, array('id'=>$this->id))) {
            $this->notify_changed(true);
            return true;

        } else {
            return false;
        }
    }
294525
public function delete()
    {
        foreach ($this->value as $index => $item) {
            $item->delete();
            unset($this->value[$index]);
        }

        return true;
    }
431868
public function remove(){
        $query = Query::delete()
            ->from(static::$_name);
        
        $conditions = [];
        $bind = [];
        
        foreach(static::$_primary as $key){
            $conditions[] = $key . ' = ?';
            $bind[] = Type\Base::getTypeObject(static::$_columns[$key], $this[$key]);
        }
        
        $query->where(implode(' AND ', $conditions))
            ->bind($bind)
            ->setDbAdapter(static::$_dbAdapter)
            ->setConsistency(static::$_writeConsistency);
        
        return $query->querySync();
    }
541481
public function delete()
    {
        $this->sql = new PhiberQueryWriter("delete", [
            "table"  => $this->table,
            "where"  => isset($this->infosMergeds['where']) ?
                $this->infosMergeds['where'] :
                null,
            "limit"  => isset($this->infosMergeds['limit']) ?
                $this->infosMergeds['limit'] :
                null,
            "offset" => isset($this->infosMergeds['offset']) ?
                $this->infosMergeds['offset'] :
                null
        ]);

        if ($this->phiberConfig->verifyExecuteQueries()) {

            $this->PDO = $this->PDO->prepare($this->sql);
            
            if (isset($this->infosMergeds['fields_and_values'])) {

                while (current($this->infosMergeds['fields_and_values'])) {
                    $this->PDO->bindValue(
                        "condition_" . key($this->infosMergeds['fields_and_values']),
                        $this->infosMergeds['fields_and_values'][key($this->infosMergeds['fields_and_values'])]
                    );

                    next($this->infosMergeds['fields_and_values']);
                }
            }
            if ($this->PDO->execute()) {
                return true;
            }
        }

        return false;
    }
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();
    }
1282425
public function removeThisAlias()
    {
        if ($this->isExternalLink()) {
            $this->delete();
        } elseif ($this->isAliasPage()) {
            $cIDRedir = $this->getCollectionPointerID();
            $db = Database::connection();

            PageStatistics::decrementParents($this->getCollectionPointerOriginalID());

            $args = [$this->getCollectionPointerOriginalID()];
            $q = 'delete from Pages where cID = ?';
            $db->executeQuery($q, $args);

            $q = 'delete from Collections where cID = ?';
            $db->executeQuery($q, $args);

            $q = 'delete from CollectionVersions where cID = ?';
            $db->executeQuery($q, $args);

            $q = 'delete from PagePaths where cID = ?';
            $db->executeQuery($q, $args);

            return $cIDRedir;
        }
    }
1159521
public function delete()
	{
		if ($this->exists)
		{
			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;
		}
	}
264074
public function erase(){
    	if($this->exists())
		{
			$query = new Query(static::table());
			$query->delete()->where($this->getIdentifyCondition());
			if($query->execute())
                $this->clear();
            return $query->success();
		}
        return false;
    }
965282
public function delete()
    {
        $query = "DELETE FROM `{$this->table}` {$this->join}";
        if ($this->condition) {
            $query .= " WHERE {$this->condition}";
        }
        if ($this->limit) {
            $query .= " LIMIT {$this->limit}";
        }

        return $this->connection->execQuery($query, $this->params);
    }
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;
    }
806567
public function delete()
    {
        $query = $this->createQuery();
        $query->setAction('delete');
        $query->where($query->buildAndSet([$this->getTableKey(), '=', $this->id]));
        $result = $this->database->query($query);

        return $result ? true : false;
    }
1226392
public function delete()
    {
        if ($this->id == 0 || $this->id == ADMIN_ID) return FALSE;
		$conn = self::getDbConnection();
		$str = 'DELETE [LOGIN='.$this->login.'][ID='.$this->id.']';
        $conn->executeQuery('DELETE FROM users_groups_membership WHERE user_id='.$this->id);
        $conn->executeQuery('DELETE FROM users_auth WHERE user_id='.$this->id);
        parent::delete();
			
	    Event::trigger(EVENT_CORE_USER_PROP,['message' => $str]);
    }
992949
public function clear()
    {
        $keys = self::$instance->keys($this->options['prefix'].'*');
        if ($keys) {
            self::$instance->del(...$keys);
        }

        return true;
    }
318528
function delete() {
        global $DB;

        if ($this->deleted) {
            return true;
        }

        $this->delete_all_sessions();

        $this->deleted = 1;
        return $this->commit();
    }
783555
private function _removeDisabledRelations()
    {
        if (!$this->attrActive) {
            return false;
        }

        foreach ($this->_relationsToSave as $key => $rel) {

            if (!isset($rel->{$this->attrActive})) {
                continue;
            }

            if (!$rel->validate() && !$rel->{$this->attrActive}) {
                ArrayHelper::remove($this->_relationsToSave, $key);
            }
        }

        return true;
    }
172828
public function forceDelete()
    {
        // get records
        $affectedRecords = $this->getAffectedRecords()->toArray();
        $ids = array_map(function($record) {
            return $record->{$this->model->getKeyName()};
        }, $affectedRecords);

        // delete main table records
        if (! $this->query->delete()) {
            return false;
        }

        // delete version table records
        $db = $this->model->getConnection();
        return $db->table($this->model->getVersionTable())
            ->whereIn($this->model->getVersionKeyName(), $ids)
            ->delete();
    }