public static function countTotal($object_id, $property) { $query = \Model_Record::query(); if (is_array($object_id)) { $query->where('object_id', 'IN', $object_id); } else { $query->where('object_id', $object_id); } $query->where('property', $property); $query->where('datatype', 'absolute'); return $query->count(); }