From 175209813fb0b886c30d9badd005ea8edcda8691 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 17 Aug 2023 11:04:28 +0300 Subject: [PATCH] add findLastHostPageDomBySelector method --- src/library/mysql.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/library/mysql.php b/src/library/mysql.php index a0090a8..2ac2654 100644 --- a/src/library/mysql.php +++ b/src/library/mysql.php @@ -640,6 +640,17 @@ class MySQL { return $query->rowCount(); } + public function findLastHostPageDomBySelector(int $hostPageId, string $selector) { + + $this->_debug->query->select->total++; + + $query = $this->_db->prepare('SELECT * FROM `hostPageDom` WHERE `hostPageId` = ? AND `selector` = ? ORDER BY `timeAdded` DESC LIMIT 1'); + + $query->execute([$hostPageId, $selector]); + + return $query->fetch(); + } + public function truncateHostPageDom() { $query = $this->_db->query('TRUNCATE `hostPageDom`');