Unlink the given term with the current model object

@param $term_id int
The ID of the term or an instance of the Term object

@return bool
TRUE if the term relation has been deleted, otherwise FALSE
174054
public function removeTerm($term_id) {
    $term_id = ($term_id instanceof Term) ? $term_id->id : $term_id;
    return $this->related()->where('term_id', $term_id)->delete();
  }
1253679
public function destroy($session_id)
	{
		if (!$this->database->del($this->key($session_id)))
		{
			return false;
		}
		return true;
	}
1218935
protected function maybeCheckTermExistsInDatabase($term_id)
    {
        if (!isset($this->config['checkExistence']) or false == $this->config['checkExistence']) {
            return;
        }
        $tableName = $this->grabPrefixedTableNameFor('terms');
        if (!$this->grabFromDatabase($tableName, 'term_id', ['term_id' => $term_id])) {
            throw new \RuntimeException("A term with an id of $term_id does not exist", 1);
        }
    }
1349976
public function remove($id)
    {
        try {
            if ($this->softDelete) {
                $removed = [];
                $removed[$this->primaryKey] = $id;
                $removed[$this->softDeleteName] = date('Y-m-d H:i:s');

                $this->save($removed);
            } else {
                $this->db->delete($this->table, array(
                    $this->primaryKey => $id
                ));
            }

            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
190047
public function delete($id)
    {
        $this->loadModel('Taxonomy.Terms');
        $term = $this->Terms->get($id);
        $this->Terms->addBehavior('Tree', ['scope' => ['vocabulary_id' => $term->vocabulary_id]]);
        $this->Terms->removeFromTree($term);

        if ($this->Terms->delete($term)) {
            $this->Flash->success(__d('taxonomy', 'Term successfully removed!'));
        } else {
            $this->Flash->danger(__d('taxonomy', 'Term could not be removed, please try again'));
        }

        $this->title(__d('taxonomy', 'Delete Term'));
        $this->redirect($this->referer());
    }
1310290
public function delete($id)
    {
        $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

        if (method_exists($this, 'beforeDelete')) {
            $this->beforeDelete();
        }

        if ($this->qb->table($this->table)->limit(1)->delete([$primaryKey => $id])) {
            if (method_exists($this, 'afterDelete')) {
                return $this->afterDelete();
            }

            return true;
        }

        return false;
    }
942597
def remove_relation(post_id, tag_id):
        '''
        
        '''
        entry = TabPost2Tag.delete().where(
            (TabPost2Tag.post_id == post_id) &
            (TabPost2Tag.tag_id == tag_id)
        )
        entry.execute()
        MCategory.update_count(tag_id)
1266185
public function delete($order_id)
    {
        $result = null;
        $this->hook->attach('order.delete.before', $order_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $result = (bool) $this->db->delete('orders', array('order_id' => $order_id));

        if ($result) {
            $this->deleteLinked($order_id);
        }

        $this->hook->attach('order.delete.after', $order_id, $result, $this);
        return (bool) $result;
    }
981001
def remove_terms(self,list_term_ids):
        
        nodes_to_remove = set()
        for term in self:
            if term.get_id() in list_term_ids:
                nodes_to_remove.add(term.get_node())
                #For removing the previous comment
                prv = term.get_node().getprevious()
                if prv is not None:
                    nodes_to_remove.add(prv)
        
        for node in nodes_to_remove:
            self.node.remove(node)
252440
public function do_destroy($session_id)
    {
        $file = $this->_getFileName($session_id);

        if (file_exists($file)) {
            @unlink($file);
        }

        return true;
    }
265199
public static function delete_by_user_id($user_id = null)
	{
		if (empty($user_id))
		{
			return true;
		}

		$results = self::all()
			->whereEquals('user_id', $user_id)
			->rows();

		foreach ($results as $result)
		{
			if (!$result->destroy())
			{
				return false;
			}
		}

		return true;
	}
1187901
public function unlink()
	{
		if ($this->mysql === null)
		{
			return false;
		}

		$query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
		$query->bindValue(':id', $this->id);
		$query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');
		$query2->bindValue(':id', $this->id);

		return $query->execute() && $query2->execute();
	}
643524
public function unlinkMany() {
        $models = func_get_args();

        if (is_array($models[0])) {
            $models = $models[0];
        }

        foreach ($models as $model) {
            $this->unlink($model);
        }

        return $this;
    }
1126315
protected function deleteLinked($category_id)
    {
        $this->db->delete('category_translation', array('category_id' => $category_id));
        $this->db->delete('file', array('entity' => 'category', 'entity_id' => $category_id));
        $this->db->delete('alias', array('entity' => 'category', 'entity_id' => $category_id));
    }
570168
public function termSave($value, int $term_id)
    {
        $this->setValue($value);

        $previous = get_term_meta($term_id, $this->getName(), true);

        if (is_null($this->getValue()) || empty($this->getValue())) {
            delete_term_meta($term_id, $this->getName());
        } elseif (empty($previous)) {
            add_term_meta($term_id, $this->getName(), $this->getRawValue(), true);
        } else {
            update_term_meta($term_id, $this->getName(), $this->getRawValue(), $previous);
        }
    }
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;
        }
    }
189313
public function hasTerm($term_id)
    {
        $taxonomy_terms = $this->getTerms();
        if (!Arr::iterable($taxonomy_terms)) {
            return false;
        }

        foreach ($taxonomy_terms as $taxonomy_key => $terms) {
            if (!Arr::iterable($terms)) {
                continue;
            }

            foreach ($terms as $term) {
                if ((int) $term->term_id === (int) $term_id) {
                    return true;
                }
            }
        }

        return false;
    }