public function __construct(XEcon $main, \mysqli $mysqli, $tbl) { parent::__construct($main); $this->db = $mysqli; $this->tbl = $tbl; $mysqli->query("CREATE TABLE IF NOT EXISTS {$tbl} (\n\t\t\t\tfromtype VARCHAR(255),\n\t\t\t\tfromname VARCHAR(255),\n\t\t\t\tfromaccount VARCHAR(255),\n\t\t\t\ttotype VARCHAR(255),\n\t\t\t\ttoname VARCHAR(255),\n\t\t\t\ttoaccount VARCHAR(255),\n\t\t\t\tamount DOUBLE,\n\t\t\t\tdetails VARCHAR(65535),\n\t\t\t\ttmstmp INT\n\t\t\t\t);"); }
/** * @param string|null $fromType * @param string|null $fromName * @param string|null $fromAccount * @param string|null $toType * @param string|null $toName * @param string|null $toAccount * @param int $tmstmpMin * @param int|null $tmstmpMax * @param int $amountMin * @param int $amountMax * @param int|string $fromToOper * @return Transaction[] */ public function getTransactions($fromType = null, $fromName = null, $fromAccount = null, $toType = null, $toName = null, $toAccount = null, $tmstmpMin = 0, $tmstmpMax = null, $amountMin = 0, $amountMax = PHP_INT_MAX, $fromToOper = LogProvider::O_OR) { // is it possible to use RegExp to filter texts in SQLite3? return $this->log->getTransactions($fromType, $fromName, $fromAccount, $toType, $toName, $toAccount, $amountMin, $amountMax, $tmstmpMin, $tmstmpMax, $fromToOper); }
public function __construct(XEcon $main, $path) { parent::__construct($main); $this->db = new \SQLite3($main->getDataFolder() . $path); $this->db->exec("CREATE TABLE IF NOT EXISTS transactions (\n\t\t\t\tfromtype TEXT,\n\t\t\t\tfromname TEXT,\n\t\t\t\tfromaccount TEXT,\n\t\t\t\ttotype TEXT,\n\t\t\t\ttoname TEXT,\n\t\t\t\ttoaccount TEXT,\n\t\t\t\tamount REAL,\n\t\t\t\tdetails TEXT,\n\t\t\t\ttmstmp INTEGER\n\t\t\t\t);"); }