function countProtocoles($type = null)
 {
     $this->loadRefFunction();
     $functions = array($this->function_id);
     $this->loadBackRefs("secondary_functions");
     foreach ($this->_back["secondary_functions"] as $curr_sec_func) {
         $functions[] = $curr_sec_func->function_id;
     }
     $list_functions = implode(",", $functions);
     $where = array("protocole.chir_id = '{$this->_id}' OR protocole.function_id IN ({$list_functions})");
     if ($type) {
         $where["type"] = "= '{$type}'";
     }
     $protocole = new CProtocole();
     $this->_count_protocoles = $protocole->countList($where);
 }
 /**
  * Count protocole
  *
  * @param string $type Type
  *
  * @return int
  */
 function countProtocoles($type = null)
 {
     $where = array("function_id" => "= '{$this->_id}'");
     if ($type) {
         $where["type"] = "= '{$type}'";
     }
     $protocole = new CProtocole();
     return $this->_count_protocoles = $protocole->countList($where);
 }