mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 17:45:31 +00:00
add text methods
This commit is contained in:
parent
f1086bfbc9
commit
4a1f06fd82
1 changed files with 34 additions and 0 deletions
|
|
@ -77,6 +77,40 @@ class AppModelDatabase
|
||||||
return $this->_debug;
|
return $this->_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Text
|
||||||
|
public function addText(string $mime, string $hash, string $value) : int
|
||||||
|
{
|
||||||
|
$this->_debug->query->insert->total++;
|
||||||
|
|
||||||
|
$query = $this->_db->prepare('INSERT INTO `text` SET `mime` = ?, `hash` = ?, `value` = ?');
|
||||||
|
|
||||||
|
$query->execute([$mime, $hash, $value]);
|
||||||
|
|
||||||
|
return $this->_db->lastInsertId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getText(int $textId)
|
||||||
|
{
|
||||||
|
$this->_debug->query->select->total++;
|
||||||
|
|
||||||
|
$query = $this->_db->prepare('SELECT * FROM `text` WHERE `textId` = ?');
|
||||||
|
|
||||||
|
$query->execute([$textId]);
|
||||||
|
|
||||||
|
return $query->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findText(string $mime, string $hash)
|
||||||
|
{
|
||||||
|
$this->_debug->query->select->total++;
|
||||||
|
|
||||||
|
$query = $this->_db->prepare('SELECT * FROM `text` WHERE `mime` = ? AND `hash` = ?');
|
||||||
|
|
||||||
|
$query->execute([$mime, $hash]);
|
||||||
|
|
||||||
|
return $query->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
// Page
|
// Page
|
||||||
public function addPage(int $timeAdded) : int
|
public function addPage(int $timeAdded) : int
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue