aboutsummaryrefslogtreecommitdiffstats
path: root/core/namespace/ItemFactory.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/namespace/ItemFactory.php')
-rw-r--r--core/namespace/ItemFactory.php23
1 files changed, 0 insertions, 23 deletions
diff --git a/core/namespace/ItemFactory.php b/core/namespace/ItemFactory.php
deleted file mode 100644
index d81ff9f..0000000
--- a/core/namespace/ItemFactory.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-abstract class ItemFactory extends Factory {
-
- #===========================================================================
- # Build instance by ID
- #===========================================================================
- public static function build($itemID): Item {
- if(!$Instance = parent::fetchInstance($itemID)) {
- $Item = (new ReflectionClass(get_called_class()))->getNamespaceName().'\\Item';
- $Instance = parent::storeInstance($itemID, new $Item($itemID, \Application::getDatabase()));
- }
-
- return $Instance;
- }
-
- #===========================================================================
- # Build instance by slug
- #===========================================================================
- public static function buildBySlug($slug): Item {
- $Item = (new ReflectionClass(get_called_class()))->getNamespaceName().'\\Item';
- return self::build($Item::getIDByField('slug', $slug, \Application::getDatabase()));
- }
-}