aboutsummaryrefslogtreecommitdiffstats
path: root/core/namespace/Application.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-06-25 22:13:59 +0200
committerThomas Lange <code@nerdmind.de>2021-06-25 22:13:59 +0200
commita86bdc6b5bab78b4026f44161413f4e482df42e4 (patch)
tree76ffd745780671371272e97b3eeac85e154e236e /core/namespace/Application.php
parent366d0de19c012821ef587d5fdb9557c339b43303 (diff)
downloadblog-a86bdc6b5bab78b4026f44161413f4e482df42e4.tar.gz
blog-a86bdc6b5bab78b4026f44161413f4e482df42e4.tar.xz
blog-a86bdc6b5bab78b4026f44161413f4e482df42e4.zip
Reorganize namespaces
Diffstat (limited to 'core/namespace/Application.php')
-rw-r--r--core/namespace/Application.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 0d6d30e..2329253 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -1,4 +1,6 @@
<?php
+use ORM\EntityInterface;
+
class Application {
#===============================================================================
@@ -97,9 +99,9 @@ class Application {
#===============================================================================
# Return singleton repository instance
#===============================================================================
- public static function getRepository(string $namespace): Repository {
- $identifier = strtolower($namespace);
- $repository = "$namespace\Repository";
+ public static function getRepository(string $entity): ORM\Repository {
+ $identifier = strtolower($entity);
+ $repository = "ORM\Repositories\\$entity";
if(!isset(self::$repositories[$identifier])) {
$Repository = new $repository(self::getDatabase());
@@ -186,13 +188,13 @@ class Application {
#===============================================================================
public static function getEntityURL(EntityInterface $Entity) {
switch($class = get_class($Entity)) {
- case 'Page\Entity':
+ case 'ORM\Entities\Page':
$attr = self::get('PAGE.SLUG_URLS') ? 'slug' : 'id';
return self::getPageURL($Entity->get($attr).'/');
- case 'Post\Entity':
+ case 'ORM\Entities\Post':
$attr = self::get('POST.SLUG_URLS') ? 'slug' : 'id';
return self::getPostURL($Entity->get($attr).'/');
- case 'User\Entity':
+ case 'ORM\Entities\User':
$attr = self::get('USER.SLUG_URLS') ? 'slug' : 'id';
return self::getUserURL($Entity->get($attr).'/');
default: