public function actionRead($id) { if ($id === NULL) { $this->table->where('date_end IS NULL OR date_end > SUBTIME(NOW(), "24:00:00")'); } parent::actionRead($id); }
public function actionRead($id) { $this->table = $this->db->table($this->data); $this->setDatabaseForData(); $this->setDatabaseForDate(); $this->setDatabaseForSeries(); parent::actionRead(NULL); }
public function actionCreateCredit($id) { $this->inputData['user'] = $id; try { $this->db->beginTransaction(); $updateQuery = 'UPDATE `user` SET `balance` = `balance` + ? WHERE `id` = ?'; $this->db->query($updateQuery, $this->inputData['amount'], $id); parent::actionCreate(); } catch (\Nette\Application\AbortException $ex) { $this->db->commit(); throw $ex; } catch (\Exception $ex) { $this->db->rollback(); } }
public function actionRead($id) { $tables = ["beer", "brewery", "consumption", "credit", "keg", "news", "tap", "user"]; parent::actionRead($id); }
public function actionRead($id) { $this->table = $this->table->select('tap.*, SUM(keg:consumption.volume) AS poured'); parent::actionRead($id); }
public function actionCreateConsumption($id) { parent::actionCreate(); }