Permalink
Browse files

Corrections

  • Loading branch information...
1 parent 7aa8ea2 commit 09adacb22269c81f5d1a0ce841d9ad97a9327b1e @Orkin committed Nov 20, 2012
View
17 src/ZfrForum/Mapper/ThreadTrackingMapperInterface.php
@@ -20,9 +20,6 @@
use Doctrine\Common\Persistence\ObjectRepository;
use ZfrForum\Entity\ThreadTracking;
-use ZfrForum\Entity\Thread;
-use ZfrForum\Entity\Category;
-use ZfcUser\Entity\UserInterface;
interface ThreadTrackingMapperInterface extends ObjectRepository
{
@@ -43,18 +40,4 @@ public function update(ThreadTracking $threadTracking);
* @return void
*/
public function remove(ThreadTracking $threadTracking);
-
- /**
- * @param Thread $thread
- * @param UserInterface $user
- * @return ThreadTracking
- */
- public function findByThreadAndUser(Thread $thread, UserInterface $user);
-
- /**
- * @param Category $category
- * @param UserInterface $user
- * @return array
- */
- public function findByCategoryAndUser(Category $category, UserInterface $user);
}
View
46 src/ZfrForum/Repository/ThreadTrackingRepository.php
@@ -19,11 +19,8 @@
namespace ZfrForum\Repository;
use Doctrine\ORM\EntityRepository;
-use ZfrForum\Entity\Thread;
use ZfrForum\Entity\ThreadTracking;
use ZfrForum\Mapper\ThreadTrackingMapperInterface;
-use ZfrForum\Entity\Category;
-use ZfcUser\Entity\UserInterface;
class ThreadTrackingRepository extends EntityRepository implements ThreadTrackingMapperInterface
{
@@ -54,47 +51,4 @@ public function remove(ThreadTracking $threadTracking)
{
// TODO: Implement remove() method.
}
-
- /**
- * @param Thread $thread
- * @param UserInterface $user
- * @return ThreadTracking
- */
- public function findByThreadAndUser(Thread $thread, UserInterface $user)
- {
- $queryBuilder = $this->getEntityManager()->createQueryBuilder();
- $queryBuilder->select('tt')
- ->from('ZfrForum\Entity\ThreadTracking', 'tt')
- ->where('tt.thread = :thread')
- ->andWhere('tt.category = :category')
- ->andWhere('tt.user = :user')
- ->setParameter('thread', $thread)
- ->setParameter('user', $user);
-
- $threadTracking = $queryBuilder->getQuery()->getOneOrNullResult();
-
- return $threadTracking;
- }
-
- /**
- * @param Category $category
- * @param UserInterface $user
- * @return array
- */
- public function findByCategoryAndUser(Category $category, UserInterface $user)
- {
- $queryBuilder = $this->getEntityManager()->createQueryBuilder();
- $queryBuilder->select('tt')
- ->from('ZfrForum\Entity\ThreadTracking', 'tt')
- ->where('ct.category = :category')
- ->andWhere('ct.user = :user')
- ->setParameter('category', $category)
- ->setParameter('user', $user);
-
- $categoryTracking = $queryBuilder->getQuery()->getResult();
-
- return $categoryTracking;
- }
-
-
}
View
3 src/ZfrForum/Service/ThreadService.php
@@ -82,8 +82,7 @@ public function addPost(Thread $thread, Post $post)
// we raised the event
$this->getEventManager()->trigger('addPost.post', this, array(
'user' => $post->getAuthor(),
- 'thread' => $thread,
- 'date' => $post->getSentAt()
+ 'thread' => $thread
));
}

0 comments on commit 09adacb

Please sign in to comment.