Skip to content
Browse files

Corrections

  • Loading branch information...
1 parent 9be2db0 commit c67a548f32289c7026136b6a51655354f1238caa @Orkin committed
View
14 src/ZfrForum/Entity/CategoryTrack.php → src/ZfrForum/Entity/CategoryTracking.php
@@ -25,9 +25,9 @@
/**
* @ORM\Entity
- * @ORM\Table(name="CategoriesTrack")
+ * @ORM\Table(name="CategoriesTracking")
*/
-class CategoryTrack
+class CategoryTracking
{
/**
* @var UserInterface
@@ -48,7 +48,7 @@ class CategoryTrack
/**
* @var DateTime
*
- * @ORM\Column(type="datetime", nullable=false)
+ * @ORM\Column(type="datetime")
*/
protected $markTime;
@@ -62,7 +62,7 @@ function __construct(UserInterface $user, Category $category)
{
$this->category = $category;
$this->user = $user;
- $this->markTime = new DateTime();
+ $this->markTime = new DateTime('now');
}
@@ -70,7 +70,7 @@ function __construct(UserInterface $user, Category $category)
* Set when all thread of the category was read
*
* @param DateTime $markTime
- * @return ForumTrack
+ * @return CategoryTracking
*/
public function setMarkTime(DateTime $markTime)
{
@@ -85,7 +85,7 @@ public function setMarkTime(DateTime $markTime)
*/
public function getMarkTime()
{
- return $this->markTime;
+ return clone $this->markTime;
}
/**
@@ -107,6 +107,4 @@ public function getUser()
{
return $this->user;
}
-
-
}
View
18 src/ZfrForum/Entity/ThreadTrack.php → src/ZfrForum/Entity/ThreadTracking.php
@@ -24,9 +24,9 @@
/**
* @ORM\Entity
- * @ORM\Table(name="ThreadsTrack")
+ * @ORM\Table(name="ThreadsTracking")
*/
-class ThreadTrack
+class ThreadTracking
{
/**
* @var UserInterface
@@ -54,7 +54,7 @@ class ThreadTrack
/**
* @var DateTime
*
- * @ORM\Column(type="datetime", nullable=false)
+ * @ORM\Column(type="datetime")
*/
protected $markTime;
@@ -63,13 +63,12 @@ class ThreadTrack
*
* @param UserInterface $user
* @param Thread $thread
- * @param Category $category
*/
- function __construct(UserInterface $user, Thread $thread, Category $category)
+ function __construct(UserInterface $user, Thread $thread)
{
$this->user = $user;
$this->thread = $thread;
- $this->category = $category;
+ $this->category = $thread->getCategory();
$this->markTime = $thread->getLastPost()->getSentAt();
}
@@ -97,7 +96,7 @@ public function getThread()
* Set the category of the thread
*
* @param Category $category
- * @return ThreadTrack
+ * @return ThreadTracking
*/
public function setCategory($category)
{
@@ -119,7 +118,7 @@ public function getCategory()
* Set the created date of the lasted post of the thread
*
* @param DateTime $markTime
- * @return ThreadTrack
+ * @return ThreadTracking
*/
public function setMarkTime(DateTime $markTime)
{
@@ -133,7 +132,6 @@ public function setMarkTime(DateTime $markTime)
*/
public function getMarkTime()
{
- return $this->markTime;
+ return clone $this->markTime;
}
-
}

0 comments on commit c67a548

Please sign in to comment.
Something went wrong with that request. Please try again.