code: public function count_by()
      {
          $where = func_get_args();
          $this->_set_where($where);
          $this->apply_soft_delete_filter();
  
          return $this->_database->count_all_results($this->_table);
      }
docs: Fetch a count of rows based on an arbitrary WHERE call.