/** * Returns data for iterator * * @return PDOStatement */ protected function _data() { if (!$this->_data) { $this->_data = $this->_query->execute(); } return $this->_data; }
/** * Set flag `is_food` for all barcodes in query * * @param RM_Db_Query * @param is_food * @return int **/ public function setFood(RM_Db_Query $query, $is_food) { $query->command('update')->set('bc.is_food = ?', $is_food); return $query->execute(); /* print_r($query->render()); exit;*/ }
/** * Description... * * @return void **/ public function initPlotByQuery($type, RM_Db_Query $q, $field, $index = NULL, array $args = array()) { $data = array(); $xLabels = NULL; foreach ($q->execute() as $row) { $data[] = $row[$field]; if (isset($args['xLabels']) || isset($args['xLabelsFunction'])) { $xLabels[] = $this->_getLabel($row, $args); } } /* if(isset($xLabels)) $this->graph(isset($args['graphIndex']) ? $args['graphIndex'] : 0)->addLabels($xLabels);*/ return $this->_createPlot($type, $index, array('data' => $data, 'xLabels' => $xLabels)); }