Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Gets the Term objects associated to that type of object with that id in this vocabulary
- *
- * @param String the name of the object type
- * @param integer The id of the object for which you want the terms
- * @return Array The Term objects requested
- **/
- public function get_object_terms($object_type, $id)
- {
- $results =
- DB::get_results( 'SELECT id, term, term_display FROM {terms}
- JOIN {object_terms} ON {terms}.id = {object_terms}.term_id
- WHERE {terms}.vocabulary_id = ?
- AND {object_terms}.object_type_id = ?
- AND {object_terms}.object_id = ?',
- array( $this->id, $type_id, $id ), 'Term' );
- return $results;
- }
Add Comment
Please, Sign In to add comment