Term

Statamic\Data\Taxonomies\Term


Inheritance: Content > Data

taxonomy

Get or set the associated taxonomy. You can pass either a string or a Taxonomy.

$term->taxonomy(); // Returns Taxonomy
$term->taxonomy($taxonomy); // Returns null

taxonomyName

Get or set the associated taxonomy.

$term->taxonomy(); // Returns a string, eg. 'tags'
$term->taxonomy('tags'); // Returns null

count

Get the number of content objects that use this term.

$term->count(); // Returns an integer

Import using:

use Statamic\Data\Taxonomies\Term