CustomFieldEntity.php
2 months ago
DynamicSegmentFilterData.php
2 months ago
DynamicSegmentFilterEntity.php
3 years ago
FeatureFlagEntity.php
3 years ago
FormEntity.php
1 week ago
LogEntity.php
3 years ago
NewsletterEntity.php
2 months ago
NewsletterLinkEntity.php
3 years ago
NewsletterOptionEntity.php
3 years ago
NewsletterOptionFieldEntity.php
1 month ago
NewsletterPostEntity.php
3 years ago
NewsletterSegmentEntity.php
3 years ago
NewsletterTemplateEntity.php
3 years ago
ScheduledTaskEntity.php
1 month ago
ScheduledTaskSubscriberEntity.php
1 year ago
SegmentEntity.php
2 months ago
SendingQueueEntity.php
2 months ago
SettingEntity.php
3 years ago
StatisticsBounceEntity.php
3 years ago
StatisticsClickEntity.php
3 years ago
StatisticsFormEntity.php
3 years ago
StatisticsNewsletterEntity.php
1 year ago
StatisticsOpenEntity.php
3 years ago
StatisticsUnsubscribeEntity.php
2 months ago
StatisticsWooCommercePurchaseEntity.php
2 years ago
StatsNotificationEntity.php
3 years ago
SubscriberCustomFieldEntity.php
3 years ago
SubscriberEntity.php
4 days ago
SubscriberIPEntity.php
3 years ago
SubscriberSegmentEntity.php
3 years ago
SubscriberTagEntity.php
4 years ago
TagEntity.php
3 years ago
UserAgentEntity.php
3 years ago
UserFlagEntity.php
3 years ago
WpPostEntity.php
2 years ago
index.php
3 years ago
TagEntity.php
68 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Entities; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait; |
| 9 | use MailPoet\Doctrine\EntityTraits\CreatedAtTrait; |
| 10 | use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait; |
| 11 | use MailPoetVendor\Doctrine\Common\Collections\ArrayCollection; |
| 12 | use MailPoetVendor\Doctrine\ORM\Mapping as ORM; |
| 13 | use MailPoetVendor\Symfony\Component\Validator\Constraints as Assert; |
| 14 | |
| 15 | /** |
| 16 | * @ORM\Entity() |
| 17 | * @ORM\Table(name="tags") |
| 18 | */ |
| 19 | class TagEntity { |
| 20 | use AutoincrementedIdTrait; |
| 21 | use CreatedAtTrait; |
| 22 | use UpdatedAtTrait; |
| 23 | |
| 24 | /** |
| 25 | * @ORM\Column(type="string") |
| 26 | * @Assert\NotBlank() |
| 27 | * @var string |
| 28 | */ |
| 29 | private $name; |
| 30 | |
| 31 | /** |
| 32 | * @ORM\Column(type="string") |
| 33 | * @var string |
| 34 | */ |
| 35 | private $description; |
| 36 | |
| 37 | /** |
| 38 | * @ORM\OneToMany(targetEntity="MailPoet\Entities\SubscriberTagEntity", mappedBy="tag", fetch="EXTRA_LAZY") |
| 39 | * @var ArrayCollection<int, SubscriberTagEntity> |
| 40 | */ |
| 41 | private $subscriberTags; |
| 42 | |
| 43 | public function __construct( |
| 44 | string $name, |
| 45 | string $description = '' |
| 46 | ) { |
| 47 | $this->name = $name; |
| 48 | $this->description = $description; |
| 49 | $this->subscriberTags = new ArrayCollection(); |
| 50 | } |
| 51 | |
| 52 | public function getName(): string { |
| 53 | return $this->name; |
| 54 | } |
| 55 | |
| 56 | public function setName(string $name): void { |
| 57 | $this->name = $name; |
| 58 | } |
| 59 | |
| 60 | public function getDescription(): string { |
| 61 | return $this->description; |
| 62 | } |
| 63 | |
| 64 | public function setDescription(string $description): void { |
| 65 | $this->description = $description; |
| 66 | } |
| 67 | } |
| 68 |