@param Term $term

@return $this
776969
public function addTerm(Term $term)
    {
        if (false === $this->terms->contains($term)) {
            $this->terms->add($term);
        }

        return $this;
    }
800112
public static function ToTitlecase($term) {
      return strtoupper(substr($term, 0, 1)) . strtolower(substr($term, 1, strlen($term)));
    }
383891
public function withTag(string $tag): self
    {
        if ($this->has($tag)) {
            return $this;
        }
        self::validateTag($tag);
        $newTags = $this->tags;
        $newTags[] = $tag;
        return new static($newTags);
    }
1352136
private function termLink(WP_Term $term): string
    {
        $link = get_term_link($term, $this->taxonomy);

        if (is_wp_error($link)) {
            $link = '';
        }

        return $link;
    }
947640
public function scopeTaxonomy(Builder $query, $taxonomy, $term): Builder
    {
        return $query->whereHas('taxonomies', function ($query) use ($taxonomy, $term) {
            $query->where('taxonomy', $taxonomy)->whereHas('term', function ($query) use ($term) {
                $query->where('slug', $term);
            });
        });
    }
1082920
public function setTerms($term_ids, $taxonomy = null, $append = false)
    {
        $taxonomy = ($taxonomy) ? $taxonomy : 'post_tag';
        if (!is_array($this->_terms)) {
            $this->_terms = array();
        }
        if (!array_key_exists($taxonomy, $this->_terms)) {
            $this->_terms[$taxonomy] = array();
        }

        $this->_terms[$taxonomy] = ($append)
            ? array_merge($this->_terms[$taxonomy], $term_ids)
            : $term_ids;
        return $this->_terms[$taxonomy];
    }
954276
public function removeTerm($term_name, $taxonomy = '')
    {
        if (! $term = $this->getTerm($term_name, $taxonomy))
            return null;

        if ($taxonomy) {
            $taxonomy = $this->taxonomies->where('taxonomy', $taxonomy)->where('term_id', $term->id)->first();
        } else {
            $taxonomy = $this->taxonomies->where('term_id', $term->id)->first();
        }

        return $this->taxed()->where('taxonomy_id', $taxonomy->id)->delete();
    }
754343
public function withTerm(Term $term, $arguments = [])
    {
        $parameters = array_merge($arguments, [
            'tax_query' => [
                [
                    'taxonomy' => $term->taxonomy_slug,
                    'field' => 'slug',
                    'terms' => $term->slug,
                ],
            ],
        ]);

        return $this->query($parameters);
    }
183349
public function undel($term)
    {
        if (
            false === $this->has_table() or
            true === $this->is_destructive
        ) {
            $this->set_error('Model '.get_class($this).' has no recoverable data');
            return false;
        }

        $term = $this->normalize_term($term);

        return $this->trash_it($term, false);
    }
1235331
def setTerms( self, terms ):
        
        return self.setRules([XQueryRule(term = term) for term in terms])
188747
public function setActiveTerm($term)
    {
        if (strlen($term)) {
            $this->putSession('term', $term);
        } else {
            $this->resetSession();
        }

        $this->activeTerm = $term;
    }
1317980
public function create($taxonomy)
    {
        if (!($taxonomy instanceof stdClass)) {
            $taxonomy = get_taxonomy($taxonomy);
        }

        return new Taxonomy($taxonomy, $this->termFactory);
    }
875031
public function set_terms( $terms = array(), $taxonomy = '', $append = false ) {
		return \wp_set_post_terms( $this->id(), $terms, $taxonomy, $append );
	}
1156338
public function getSearchFilters($term)
    {
        $filters = [];
        
        foreach ($this->getSearchFields() as $field) {
            $filters[$this->getSearchFilterName($field)] = $term;
        }
        
        return $filters;
    }
918169
protected void setIsNewWord(Term term) {

		if (!isNewWord) {
			return;
		}

		if (term.termNatures().id > 0) {
			return;
		}

		int id = DATDictionary.getId(term.getName());

		if (id > 0) {
			return;
		}

		if (forests != null) {
			for (int i = 0; i < forests.length; i++) {
				if (forests[i] == null) {
					continue;
				}

				SmartForest<String[]> branch = forests[i].getBranch(term.getName());

				if (branch == null) {
					continue;
				}

				if (branch.getStatus() > 1) {
					return;
				}
			}
		}

		term.setNewWord(true);

	}
1219119
public function setParent(\Neobazaar\Entity\TermTaxonomy $parent = null)
    {
        $this->parent = $parent;
    
        return $this;
    }
508982
public function AddDefinition($Term, $Definition = NULL) {
      if(!is_null($Definition)) {
         // Make sure the term is a valid id.
         if (!preg_match('/[a-z][0-9a-z_\-]*/i', $Term))
            throw new Exception('Definition term must start with a letter or an underscore and consist of alphanumeric characters.');
         $this->_Definitions[$Term] = $Definition;
      }
      return ArrayValue($Term, $this->_Definitions);
   }