From 0f0700f87b38471bd9a83506ff994b2ba3f03805 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Wed, 23 Mar 2016 19:59:06 +0300 Subject: [PATCH] Repositories refactoring. TopUserDTO moved. --- .../Bundle/PointToolsBundle/Controller/UserController.php | 2 +- .../Bundle/PointToolsBundle/{Entity => DTO}/TopUserDTO.php | 2 +- src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Post.php | 2 +- src/Skobkin/Bundle/PointToolsBundle/Entity/Blogs/Tag.php | 2 +- src/Skobkin/Bundle/PointToolsBundle/Entity/Subscription.php | 2 +- .../Bundle/PointToolsBundle/Entity/SubscriptionEvent.php | 2 +- src/Skobkin/Bundle/PointToolsBundle/Entity/User.php | 2 +- .../{Entity => Repository}/Blogs/PostRepository.php | 2 +- .../{Entity => Repository}/Blogs/TagRepository.php | 3 ++- .../{Entity => Repository}/SubscriptionEventRepository.php | 4 +++- .../{Entity => Repository}/SubscriptionRepository.php | 2 +- .../{Entity => Repository}/UserRepository.php | 6 ++++-- 12 files changed, 18 insertions(+), 13 deletions(-) rename src/Skobkin/Bundle/PointToolsBundle/{Entity => DTO}/TopUserDTO.php (87%) rename src/Skobkin/Bundle/PointToolsBundle/{Entity => Repository}/Blogs/PostRepository.php (61%) rename src/Skobkin/Bundle/PointToolsBundle/{Entity => Repository}/Blogs/TagRepository.php (83%) rename src/Skobkin/Bundle/PointToolsBundle/{Entity => Repository}/SubscriptionEventRepository.php (92%) rename src/Skobkin/Bundle/PointToolsBundle/{Entity => Repository}/SubscriptionRepository.php (91%) rename src/Skobkin/Bundle/PointToolsBundle/{Entity => Repository}/UserRepository.php (89%) diff --git a/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php b/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php index 4a78cc9..e622303 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php +++ b/src/Skobkin/Bundle/PointToolsBundle/Controller/UserController.php @@ -3,7 +3,7 @@ namespace Skobkin\Bundle\PointToolsBundle\Controller; use Doctrine\ORM\EntityManager; -use Skobkin\Bundle\PointToolsBundle\Entity\TopUserDTO; +use Skobkin\Bundle\PointToolsBundle\DTO\TopUserDTO; use Skobkin\Bundle\PointToolsBundle\Entity\User; use Skobkin\Bundle\PointToolsBundle\Service\UserApi; use Symfony\Bundle\FrameworkBundle\Controller\Controller; diff --git a/src/Skobkin/Bundle/PointToolsBundle/Entity/TopUserDTO.php b/src/Skobkin/Bundle/PointToolsBundle/DTO/TopUserDTO.php similarity index 87% rename from src/Skobkin/Bundle/PointToolsBundle/Entity/TopUserDTO.php rename to src/Skobkin/Bundle/PointToolsBundle/DTO/TopUserDTO.php index 5e2545c..ca1f126 100644 --- a/src/Skobkin/Bundle/PointToolsBundle/Entity/TopUserDTO.php +++ b/src/Skobkin/Bundle/PointToolsBundle/DTO/TopUserDTO.php @@ -1,6 +1,6 @@ getEntityManager()->getRepository('SkobkinPointToolsBundle:Subscription')->createQueryBuilder('s'); return $qb - ->select(['COUNT(s.subscriber) as cnt', 'NEW SkobkinPointToolsBundle:TopUserDTO(a.login, COUNT(s.subscriber))']) + ->select(['COUNT(s.subscriber) as cnt', 'NEW Skobkin\Bundle\PointToolsBundle\DTO\TopUserDTO(a.login, COUNT(s.subscriber))']) ->innerJoin('s.author', 'a') ->orderBy('cnt', 'desc') ->groupBy('a.id')