/** * Gets photographer data * * @return SwatTableModel with photographer information. */ protected function getTableModel(SwatView $view) { $sql = 'select * from PinholePhotographer where instance %s %s order by %s'; $instance_id = $this->app->getInstanceId(); $sql = sprintf($sql, SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer'), $this->getOrderByClause($view, 'id')); $rs = SwatDB::query($this->app->db, $sql); foreach ($rs as $row) { $row->status_title = PinholePhotographer::getStatusTitle($row->status); } return $rs; }
protected function buildInternal() { parent::buildInternal(); $this->ui->getWidget('status')->addOptionsByArray(PinholePhotographer::getStatuses()); }