_sTableData = $aParams['table_data'] ?? ''; } public function getLocal ($sUrl, $sTheme) { return $this->getOne("SELECT `data` FROM `" . $this->_sTableData . "` WHERE `url` = :url AND `theme` = :theme", [ 'url' => $sUrl, 'theme' => $sTheme ]); } public function getLocalInfo ($sUrl, $sTheme) { return $this->getRow("SELECT * FROM `" . $this->_sTableData . "` WHERE `url` = :url AND `theme` = :theme", [ 'url' => $sUrl, 'theme' => $sTheme ]); } public function getLocalInfoById ($iId) { return $this->getRow("SELECT * FROM `" . $this->_sTableData . "` WHERE `id` = :id", [ 'id' => $iId ]); } public function getLocalUnprocessed () { return $this->getAll("SELECT * FROM `" . $this->_sTableData . "` WHERE `data` = ''"); } public function insertLocal ($sUrl, $sTheme, $sData = '') { return (int)$this->query("INSERT INTO `" . $this->_sTableData . "` (`url`, `theme`, `data`, `added`) VALUES (:url, :theme, :data, :added)", [ 'url' => $sUrl, 'theme' => $sTheme, 'data' => $sData, 'added' => time(), ]) > 0 ? $this->lastId() : false; } public function updateLocal($aParamsSet, $aParamsWhere) { if(empty($aParamsSet) || empty($aParamsWhere)) return false; return $this->query("UPDATE `{$this->_sTableData}` SET " . $this->arrayToSQL($aParamsSet) . " WHERE " . $this->arrayToSQL($aParamsWhere, " AND ")); } public function deleteLocal($aParamsWhere) { if(empty($aParamsWhere)) return false; return $this->query("DELETE FROM `{$this->_sTableData}` WHERE " . $this->arrayToSQL($aParamsWhere, " AND ")); } } /** @} */