Example #1
0
 /**
  * Gets total count of search with $_filter
  * 
  * @param Tinebase_Model_Filter_FilterGroup $_filter
  * @param string|optional $_action
  * @return int
  */
 public function searchCount(Tinebase_Model_Filter_FilterGroup $_filter, $_action = 'get')
 {
     $path = $this->_checkFilterACL($_filter, $_action);
     if ($path->containerType === Tinebase_Model_Tree_Node_Path::TYPE_ROOT) {
         $result = count($this->_getRootNodes());
     } else {
         if ($path->containerType === Tinebase_Model_Container::TYPE_PERSONAL && !$path->containerOwner) {
             $result = count($this->_getOtherUserNodes());
         } else {
             $result = $this->_backend->searchNodesCount($_filter);
         }
     }
     return $result;
 }