1 | <?php |
||
37 | class Taxonomy extends Type implements Registerable |
||
38 | { |
||
39 | /** |
||
40 | * Taxonomy Constructor. |
||
41 | * |
||
42 | * @param object $taxonomy The taxonomy object |
||
43 | * |
||
44 | * @throws NonExistentTaxonomyException |
||
45 | */ |
||
46 | public function __construct($taxonomy) |
||
54 | |||
55 | /** |
||
56 | * Create a new instance using the taxonomy identifier. |
||
57 | * |
||
58 | * @param string $id Taxonomy name/identifier |
||
59 | * |
||
60 | * @throws InvalidTaxonomyNameException |
||
61 | * |
||
62 | * @return static|Builder |
||
63 | */ |
||
64 | public static function make($id) |
||
76 | |||
77 | /** |
||
78 | * Create a new instance from an existing taxonomy. |
||
79 | * |
||
80 | * @param string $id The taxonomy identifier |
||
81 | * |
||
82 | * @throws NonExistentTaxonomyException |
||
83 | * |
||
84 | * @return static |
||
85 | */ |
||
86 | public static function load($id) |
||
94 | |||
95 | /** |
||
96 | * Build a new Taxonomy to be registered. |
||
97 | * |
||
98 | * @param $id |
||
99 | * |
||
100 | * @return Builder |
||
101 | */ |
||
102 | public static function build($id) |
||
106 | |||
107 | /** |
||
108 | * Check if a Taxonomy exists for the given identifier. |
||
109 | * |
||
110 | * @param string $id The taxonomy key/identifier |
||
111 | * |
||
112 | * @return bool |
||
113 | */ |
||
114 | public static function exists($id) |
||
118 | |||
119 | /** |
||
120 | * @return mixed |
||
121 | */ |
||
122 | public function id() |
||
126 | |||
127 | /** |
||
128 | * Start a new query for terms of this taxonomy. |
||
129 | * |
||
130 | * @return QueryBuilder |
||
131 | */ |
||
132 | public function terms() |
||
136 | |||
137 | /** |
||
138 | * Get all post types associated with this taxonomy. |
||
139 | * |
||
140 | * @return Collection |
||
141 | */ |
||
142 | public function postTypes() |
||
149 | |||
150 | /** |
||
151 | * Unregister the taxonomy. |
||
152 | * |
||
153 | * @throws NonExistentTaxonomyException |
||
154 | * @throws WP_ErrorException |
||
155 | * |
||
156 | * @return $this |
||
157 | */ |
||
158 | public function unregister() |
||
170 | } |
||
171 |