<?php

namespace CliqThemes\ORM\Entities;

use CliqThemes\ORM\Model;

/**
 * ORM model representing the wp_terms table.
 */
class Term extends Model
{
    protected string $table = 'terms';

    protected string $primaryKey = 'term_id';

    protected array $fillable = [
        'name',
        'slug',
        'term_group',
    ];

    protected bool $timestamps = false;

    /**
     * Relationship to taxonomy records associated with the term.
     */
    public function taxonomy()
    {
        return $this->hasMany(TermTaxonomy::class, 'term_id', 'term_id');
    }
}

