Create StatsNotifications entity
[MAILPOET-2439]
This commit is contained in:
committed by
Jack Kitterhing
parent
1095cba1f1
commit
92bbb3f4e8
52
lib/Entities/StatsNotificationEntity.php
Normal file
52
lib/Entities/StatsNotificationEntity.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Entities;
|
||||
|
||||
use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\CreatedAtTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait;
|
||||
use MailPoetVendor\Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="stats_notifications")
|
||||
*/
|
||||
class StatsNotificationEntity {
|
||||
use AutoincrementedIdTrait;
|
||||
use CreatedAtTrait;
|
||||
use UpdatedAtTrait;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="MailPoet\Entities\NewsletterEntity")
|
||||
* @ORM\JoinColumn(name="newsletter_id", referencedColumnName="id")
|
||||
* @var NewsletterEntity
|
||||
*/
|
||||
private $newsletter;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity")
|
||||
* @ORM\JoinColumn(name="task_id", referencedColumnName="id")
|
||||
* @var ScheduledTaskEntity
|
||||
*/
|
||||
private $task;
|
||||
|
||||
function __construct(NewsletterEntity $newsletter, ScheduledTaskEntity $task) {
|
||||
$this->newsletter = $newsletter;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NewsletterEntity
|
||||
*/
|
||||
public function getNewsletter() {
|
||||
return $this->newsletter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ScheduledTaskEntity
|
||||
*/
|
||||
public function getTask() {
|
||||
return $this->task;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user