/**
  * Searches tags according to filter and paging
  * The Current user needs to have the given right, unless $_ignoreAcl is true
  * 
  * @param  Tinebase_Model_TagFilter $_filter
  * @param  Tinebase_Model_Pagination  $_paging
  * @return Tinebase_Record_RecordSet  Set of Tinebase_Model_Tag
  */
 public function searchTags($_filter, $_paging = NULL)
 {
     $select = $_filter->getSelect();
     Tinebase_Model_TagRight::applyAclSql($select, $_filter->grant);
     if (isset($_filter->application)) {
         $app = Tinebase_Application::getInstance()->getApplicationByName($_filter->application);
         $this->_filterSharedOnly($select, $app->getId());
     }
     if ($_paging !== NULL) {
         $_paging->appendPaginationSql($select);
     }
     Tinebase_Backend_Sql_Abstract::traitGroup($select);
     $tags = new Tinebase_Record_RecordSet('Tinebase_Model_Tag', $this->_db->fetchAssoc($select));
     return $tags;
 }
Example #2
0
 /**
  * Returns tags count of a tag search
  * @todo automate the count query if paging is active!
  *
  * @param  Tinebase_Model_TagFilter $_filter
  * @return int
  */
 public function getSearchTagsCount($_filter)
 {
     $select = $_filter->getSelect();
     Tinebase_Model_TagRight::applyAclSql($select, $_filter->grant);
     $tags = new Tinebase_Record_RecordSet('Tinebase_Model_Tag', $this->_db->fetchAssoc($select));
     return count($tags);
 }