From 04fc009874db2d539ad881b649f7ebb512f05312 Mon Sep 17 00:00:00 2001 From: floppydiskette Date: Thu, 8 Aug 2024 22:22:38 +0100 Subject: Init rails app --- app/Models/BookmarkCategory.php | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 app/Models/BookmarkCategory.php (limited to 'app/Models/BookmarkCategory.php') diff --git a/app/Models/BookmarkCategory.php b/app/Models/BookmarkCategory.php deleted file mode 100644 index a8bc8d2..0000000 --- a/app/Models/BookmarkCategory.php +++ /dev/null @@ -1,36 +0,0 @@ -hasMany(BookmarkSite::class, 'category'); - } - - public static function insertBookmarkCategory(string $name) { - $newBookmarkCategory = new BookmarkCategory; - $newBookmarkCategory->name = $name; - $newBookmarkCategory->save(); - } - public static function selectBookmarks(int $id) { - $bookmarks = BookmarkSite::where('category', '=', $id)->firstOrFail(); - return $bookmarks; - } - - public static function importBookmarkCategory(array $data) { - foreach ($data as $category) { - $newBookmarkCategory = new BookmarkCategory; - $newBookmarkCategory->name = $category['name']; - $newBookmarkCategory->priority = intval($category['priority']); - $newBookmarkCategory->save(); - } - } -} -- cgit v1.2.3-54-g00ecf