public function testStartToEndExecution() { $workflow = new \ezcWorkflow('Test'); $workflow->startNode->addOutNode($workflow->endNode); $this->manager->save($workflow); $execution = $this->manager->createExecution($workflow); $execution->workflow = $workflow; $execution->setVariable('foo', 'bar'); $execution->setVariable('bar', 'baz'); $execution->start(); $this->assertEquals(0, count($this->conn->fetchAll('SELECT * FROM ' . $this->options->executionTable()))); $this->assertEquals(0, count($this->conn->fetchAll('SELECT * FROM ' . $this->options->executionStateTable()))); }
public static function getAll($mysqli) { $stmt = $mysqli->prepare("\n SELECT * FROM `settings`\n "); $res = array(); foreach (Connection::fetchAll($stmt) as $row) { $res[$row->key] = $row->value; } return $res; }
public static function getMultiYear($mysqli, $start_year, $end_year) { $stmt = $mysqli->prepare("\n SELECT * FROM `annual_breakdown`\n WHERE `year` >= ? AND `year` <= ?\n "); $stmt->bind_param('ii', $start_year, $end_year); foreach (Connection::fetchAll($stmt) as $row) { $row = self::scaleDown($row); $res[$row->year][$row->category] = $row->value; } return $res; }
private static function getInvestmentsHelper($mysqli, $start_year, $end_year, $start_month = 1, $end_month = 12) { $stmt = $mysqli->prepare("\n SELECT\n *,\n `value_ret_pretax` + `value_ret_posttax` AS `value_ret`,\n `value_no_ret` + `value_ret_posttax` AS `value_posttax`,\n `value_ret_pretax` + `value_ret_posttax` + `value_no_ret` AS `value`\n FROM `investments`\n LEFT JOIN `investment_category` ON `category_key` = `key`\n WHERE\n (`year` > ? OR (`year` = ? AND `month` >= ?)) AND\n (`year` < ? OR (`year` = ? AND `month` <= ?))\n ORDER BY `year`, `month`, `rank` desc\n "); $stmt->bind_param('iiiiii', $start_year, $start_year, $start_month, $end_year, $end_year, $end_month); $res = Connection::fetchAll($stmt); foreach ($res as $key => $i) { $res[$key] = self::scaleDown($i); } return $res; }
public static function getTargets($mysqli) { $stmt = $mysqli->prepare("\n SELECT * FROM `investment_target` LEFT JOIN investment_category ON `category_key` = `key` ORDER BY `percent` desc\n "); return Connection::fetchAll($stmt); }
/** * @param array $columnsToSelect * @return array */ public function allAsArray($columnsToSelect = ['*']) { return $this->connection->fetchAll($this->getSelectQuery($columnsToSelect), $this->getBindingValues()); }