Guest User

Untitled

a guest
Jul 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. /**
  2. * Gets the Term objects associated to that type of object with that id in this vocabulary
  3. *
  4. * @param String the name of the object type
  5. * @param integer The id of the object for which you want the terms
  6. * @return Array The Term objects requested
  7. **/
  8. public function get_object_terms($object_type, $id)
  9. {
  10. $results =
  11. DB::get_results( 'SELECT id, term, term_display FROM {terms}
  12. JOIN {object_terms} ON {terms}.id = {object_terms}.term_id
  13. WHERE {terms}.vocabulary_id = ?
  14. AND {object_terms}.object_type_id = ?
  15. AND {object_terms}.object_id = ?',
  16. array( $this->id, $type_id, $id ), 'Term' );
  17.  
  18. return $results;
  19. }
Add Comment
Please, Sign In to add comment