diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-26 22:17:55 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-01-26 22:24:47 +0200 |
| commit | 39f5b1fce005ff0a2c3cb552c4ec5f478ab0b831 (patch) | |
| tree | fd0bc682d9730ab722a02e5d9c10dc945fa3cd3f /models | |
| parent | 6082680e8655efcec0b255047b5b27064bf9fc3f (diff) | |
| download | nowayforward_human-39f5b1fce005ff0a2c3cb552c4ec5f478ab0b831.tar nowayforward_human-39f5b1fce005ff0a2c3cb552c4ec5f478ab0b831.tar.gz nowayforward_human-39f5b1fce005ff0a2c3cb552c4ec5f478ab0b831.zip | |
feat: Add fromWid, addItem
Diffstat (limited to 'models')
| -rw-r--r-- | models/archivelist.php | 10 | ||||
| -rw-r--r-- | models/webpage.php | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/models/archivelist.php b/models/archivelist.php index 25b75fe..09d5d86 100644 --- a/models/archivelist.php +++ b/models/archivelist.php @@ -26,8 +26,16 @@ class ArchiveList extends Table { static function allListsByUser(int $UID) : array { return Table::_get_all( 'ArchiveLists', - 'Database\ArchiveLists', + 'Database\ArchiveList', "WHERE AuthorUID = \"$UID\"" ); } + + function addItem(int $WID) { + Table::_create( + 'ArchiveListsWebpages', + '(WID, LID, Position)', + "(\"$WID\", \"$this->LID\", \"0\")" + ); + } } diff --git a/models/webpage.php b/models/webpage.php index e6d964f..ceb9cea 100644 --- a/models/webpage.php +++ b/models/webpage.php @@ -27,9 +27,9 @@ class Webpage extends Table { ); } - static function getPageById(int $id) : Webpage { + static function fromDBwid(int $WID) : Webpage { return Table::_fromDB( - "SELECT * FROM Webpages WHERE WID = \"$id\"", + "SELECT * FROM Webpages WHERE WID = \"$WID\"", "Database\Webpage" ); } |
