More SubscriptionEvent optimization.
This commit is contained in:
parent
c3d430e8f8
commit
366396a4c2
|
@ -10,8 +10,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
* @ORM\Index(name="subscriber_idx", columns={"subscriber_id"}),
|
||||
* @ORM\Index(name="date_idx", columns={"date"})
|
||||
* })
|
||||
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionEventRepository")
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionEventRepository", readOnly=true)
|
||||
*/
|
||||
class SubscriptionEvent
|
||||
{
|
||||
|
@ -68,17 +67,8 @@ class SubscriptionEvent
|
|||
$this->author = $author;
|
||||
$this->subscriber = $subscriber;
|
||||
$this->action = $action;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PrePersist
|
||||
*/
|
||||
public function onCreate()
|
||||
{
|
||||
if (!$this->date) {
|
||||
$this->date = new \DateTime();
|
||||
}
|
||||
}
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue