diff options
Diffstat (limited to 'core/namespace/ORM/Repositories/Post.php')
-rw-r--r-- | core/namespace/ORM/Repositories/Post.php | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/core/namespace/ORM/Repositories/Post.php b/core/namespace/ORM/Repositories/Post.php index d6328e6..7f672e5 100644 --- a/core/namespace/ORM/Repositories/Post.php +++ b/core/namespace/ORM/Repositories/Post.php @@ -7,25 +7,4 @@ use ORM\Entities\Category; class Post extends Repository { public static function getTableName(): string { return 'post'; } public static function getClassName(): string { return 'ORM\Entities\Post'; } - - 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(); - } - - # TODO: This only gets the count of the direct category, not its children - public function getCountByCategory(Category $Category): int { - $query = 'SELECT COUNT(id) FROM %s WHERE category = ?'; - $query = sprintf($query, static::getTableName()); - - $Statement = $this->Database->prepare($query); - $Statement->execute([$Category->getID()]); - - return $Statement->fetchColumn(); - } } |