Corcel\PostMeta::taxonomy PHP Method

taxonomy() public method

Taxonomy relationship from the meta_value.
public taxonomy ( $primary = null, $where = null ) : Illuminate\Database\Eloquent\Relations\Relation
return Illuminate\Database\Eloquent\Relations\Relation
    public function taxonomy($primary = null, $where = null)
    {
        // possible to exclude a relationship connection
        if (!is_null($primary) && !empty($primary)) {
            $this->primaryKey = $primary;
        }
        // load relationship
        $relation = $this->hasOne('Corcel\\TermTaxonomy', 'term_taxonomy_id');
        // do we need to filter which value to look for with meta_value
        // if (!is_null($where) && !empty($where)) {
        //     $relation->where($where, $this->meta_value);
        // }
        return $relation;
    }