Permalink
Browse files

Corrections

  • Loading branch information...
1 parent 09adacb commit f45a88127be88d7d53d76828613341f989ba2c41 @Orkin committed Nov 21, 2012
View
@@ -46,9 +46,9 @@ public function onBootstrap(EventInterface $e)
/* @var $threadService \ZfrForum\Service\ThreadService */
$threadService = $e->getTarget();
- $params = $e->getParams();
- $user = $params['user'];
- $thread = $params['thread'];
+ $params = $e->getParams();
+ $user = $params['user'];
+ $thread = $params['thread'];
$threadService->track($user, $thread);
});
@@ -62,7 +62,7 @@ class CategoryTracking
function __construct(UserInterface $user, Category $category)
{
$this->category = $category;
- $this->user = $user;
+ $this->user = $user;
$this->markTime = new DateTime('now');
}
@@ -69,8 +69,8 @@ class ThreadTracking
*/
function __construct(UserInterface $user, Thread $thread)
{
- $this->user = $user;
- $this->thread = $thread;
+ $this->user = $user;
+ $this->thread = $thread;
$this->category = $thread->getCategory();
$this->markTime = $thread->getLastPost()->getSentAt();
}
@@ -27,7 +27,7 @@
* @param ThreadTracking $threadTracking
* @return ThreadTracking
*/
- public function add(ThreadTracking $threadTracking);
+ public function create(ThreadTracking $threadTracking);
/**
* @param ThreadTracking $threadTracking
@@ -19,11 +19,8 @@
namespace ZfrForum\Repository;
use Doctrine\ORM\EntityRepository;
-use ZfrForum\Entity\Thread;
use ZfrForum\Entity\CategoryTracking;
use ZfrForum\Mapper\CategoryTrackingMapperInterface;
-use ZfrForum\Entity\Category;
-use ZfcUser\Entity\UserInterface;
class CategoryTrackingRepository extends EntityRepository implements CategoryTrackingMapperInterface
{
@@ -28,7 +28,7 @@ class ThreadTrackingRepository extends EntityRepository implements ThreadTrackin
* @param ThreadTracking $threadTracking
* @return ThreadTracking
*/
- public function add(ThreadTracking $threadTracking)
+ public function create(ThreadTracking $threadTracking)
{
}
@@ -53,7 +53,9 @@ class ThreadService extends EventProvider
* @param ThreadTrackingMapperInterface $threadTrackingMapper
* @param AuthenticationService $authenticationService
*/
- public function __construct(ThreadMapperInterface $threadMapper, ThreadTrackingMapperInterface $threadTrackingMapper,
+ public function __construct(
+ ThreadMapperInterface $threadMapper,
+ ThreadTrackingMapperInterface $threadTrackingMapper,
AuthenticationService $authenticationService)
{
$this->threadMapper = $threadMapper;
@@ -156,7 +158,7 @@ public function track(UserInterface $user, Thread $thread) {
// There is not a track for this thread
if ($threadTracking === null) {
$threadTracking = new ThreadTracking($user, $thread);
- $this->threadTrackingMapper->add($threadTracking);
+ $this->threadTrackingMapper->create($threadTracking);
} elseif ($threadTracking->getMarkTime() < $thread->getLastPost()->getSentAt()) {
$threadTracking->setMarkTime($thread->getLastPost()->getSentAt());
$this->threadTrackingMapper->update($threadTracking);

0 comments on commit f45a881

Please sign in to comment.