3 require_once( dirname(__FILE__
).'/base/baseobjectset.php' );
6 * Describes a set of objects from livestatus
8 abstract class ObjectSet_Model
extends BaseObjectSet_Model
{
11 * Get statistics about the set, by default only the count
13 public function get_totals() {
14 return array('count' => array($this->get_query(), count($this)));
18 * Get the query representing the set
20 public function get_query() {
21 return '['.$this->table
.'] '.$this->filter
->visit(new LSFilterQueryBuilderVisitor(), 0);
25 * Get the first matching object in the set
27 public function one($columns = array()) {
29 $columns = (array) $columns;
31 return $this->it($columns, array(),1,0)->current();
35 * FOR TESTING PURPOSE!
37 * Visit filter with an visitor and return the result
39 public function test_visit_filter(LivestatusFilterVisitor
$visitor, $data) {
40 return $this->filter
->visit($visitor,$data);