From 01d4727f939c0b9530fe5fc976b7accb9e078db1 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 20 Jul 2021 00:27:46 +0200 Subject: Rename and reorganize several "get count" methods --- core/namespace/ORM/Repositories/Page.php | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'core/namespace/ORM/Repositories/Page.php') diff --git a/core/namespace/ORM/Repositories/Page.php b/core/namespace/ORM/Repositories/Page.php index 595b420..714605e 100644 --- a/core/namespace/ORM/Repositories/Page.php +++ b/core/namespace/ORM/Repositories/Page.php @@ -6,14 +6,4 @@ use ORM\Entities\User; class Page extends Repository { public static function getTableName(): string { return 'page'; } public static function getClassName(): string { return 'ORM\Entities\Page'; } - - public function getCountByUser(User $User): int { - $query = 'SELECT COUNT(id) FROM %s WHERE user = ?'; - $query = sprintf($query, static::getTableName()); - - $Statement = $this->Database->prepare($query); - $Statement->execute([$User->getID()]); - - return $Statement->fetchColumn(); - } } -- cgit v1.2.3