Create score columns

[MAILPOET-3525]
This commit is contained in:
Pavel Dohnal
2021-04-19 14:41:59 +02:00
committed by Veljko V
parent d44636a69f
commit 5d4916efc3
2 changed files with 41 additions and 0 deletions

View File

@ -216,6 +216,8 @@ class Migrator {
'count_confirmations int(11) unsigned NOT NULL DEFAULT 0,',
'unsubscribe_token char(15) NULL,',
'link_token char(32) NULL,',
'engagement_score tinyint unsigned NULL,',
'engagement_score_updated_at timestamp NULL,',
'PRIMARY KEY (id),',
'UNIQUE KEY email (email),',
'UNIQUE KEY unsubscribe_token (unsubscribe_token),',

View File

@ -125,6 +125,17 @@ class SubscriberEntity {
*/
private $linkToken;
/**
* @ORM\Column(type="integer")
* @var int|null
*/
private $engagementScore;
/**
* @ORM\Column(type="datetimetz", nullable=true)
* @var DateTimeInterface|null
*/
private $engagementScoreUpdatedAt;
/**
* @ORM\OneToMany(targetEntity="MailPoet\Entities\SubscriberSegmentEntity", mappedBy="subscriber")
@ -397,4 +408,32 @@ class SubscriberEntity {
return $segment !== null;
});
}
/**
* @return int|null
*/
public function getEngagementScore(): ?int {
return $this->engagementScore;
}
/**
* @param int|null $engagementScore
*/
public function setEngagementScore(?int $engagementScore): void {
$this->engagementScore = $engagementScore;
}
/**
* @return DateTimeInterface|null
*/
public function getEngagementScoreUpdatedAt(): ?DateTimeInterface {
return $this->engagementScoreUpdatedAt;
}
/**
* @param DateTimeInterface|null $engagementScoreUpdatedAt
*/
public function setEngagementScoreUpdatedAt(?DateTimeInterface $engagementScoreUpdatedAt): void {
$this->engagementScoreUpdatedAt = $engagementScoreUpdatedAt;
}
}