Ejemplo n.º 1
0
 /**
  * Get all the tags on an object
  *
  * @param      integer $object_id Object ID
  * @param      integer $offset    Record offset
  * @param      integer $limit     Record limit
  * @param      integer $tagger_id Tagger ID (set this if you want to restrict tags only added by a specific user)
  * @param      integer $strength  Tag strength (set this if you want to restrict tags by strength)
  * @param      integer $admin     Has admin access?
  * @return     array
  */
 public function get_tags_on_object($object_id, $offset = 0, $limit = 10, $tagger_id = NULL, $strength = 0, $admin = 0, $label = '')
 {
     if (!isset($object_id)) {
         $this->setError('get_tags_on_object argument missing');
         return array();
     }
     $to = new \Components\Tags\Tables\Object($this->_db);
     $to->objectid = $object_id;
     $to->tbl = $this->_tbl;
     $to->strength = $strength;
     $to->taggerid = $tagger_id;
     $to->label = $label;
     $tags = $to->getTagsOnObject($object_id, $this->_tbl, $admin, $offset, $limit);
     if (!$tags) {
         $this->setError($to->getError());
         return array();
     }
     return $tags;
 }