function newSelection(IdentityObject $obj) { $fields = implode(',', $obj->getObjectFields()); $core = "SELECT {$fields} FROM space"; list($where, $values) = $this->buildWhere($obj); return array($core . " " . $where, $values); }
function buildWhere(IdentityObject $obj) { if ($obj->isVoid()) { return array("", array()); } $compstrings = array(); $values = array(); foreach ($obj->getComps() as $comp) { $compstrings[] = "{$comp['name']} {$comp['operator']} ?"; $values[] = $comp['value']; } $where = "WHERE " . implode(" AND ", $compstrings); return array($where, $values); }
function __construct($field = null) { parent::__construct($field, array('name', 'id', 'venue')); }
function __construct($field = null) { parent::__construct($field, array('name', 'id', 'start', 'duration', 'space')); }
public function __construct($field = null) { parent::__construct($field, array('id', 'sitting_time', 'name')); }