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
CustomFieldEntity.php
94 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 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\DeletedAtTrait; |
| 11 | use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait; |
| 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="custom_fields") |
| 18 | */ |
| 19 | class CustomFieldEntity { |
| 20 | public const TYPE_DATE = 'date'; |
| 21 | public const TYPE_TEXT = 'text'; |
| 22 | public const TYPE_TEXTAREA = 'textarea'; |
| 23 | public const TYPE_RADIO = 'radio'; |
| 24 | public const TYPE_CHECKBOX = 'checkbox'; |
| 25 | public const TYPE_SELECT = 'select'; |
| 26 | |
| 27 | use AutoincrementedIdTrait; |
| 28 | use CreatedAtTrait; |
| 29 | use DeletedAtTrait; |
| 30 | use UpdatedAtTrait; |
| 31 | |
| 32 | /** |
| 33 | * @ORM\Column(type="string", nullable=false, unique=true) |
| 34 | * @Assert\NotBlank() |
| 35 | * @var string |
| 36 | */ |
| 37 | private $name; |
| 38 | |
| 39 | /** |
| 40 | * @ORM\Column(type="string", nullable=false) |
| 41 | * @Assert\NotBlank() |
| 42 | * @var string |
| 43 | */ |
| 44 | private $type; |
| 45 | |
| 46 | /** |
| 47 | * @ORM\Column(type="array") |
| 48 | * @var array |
| 49 | */ |
| 50 | private $params; |
| 51 | |
| 52 | /** |
| 53 | * @return string |
| 54 | */ |
| 55 | public function getName() { |
| 56 | return $this->name; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @return string |
| 61 | */ |
| 62 | public function getType() { |
| 63 | return $this->type; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @return array|null |
| 68 | */ |
| 69 | public function getParams() { |
| 70 | return $this->params; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @param string $name |
| 75 | */ |
| 76 | public function setName($name) { |
| 77 | $this->name = $name; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @param string $type |
| 82 | */ |
| 83 | public function setType($type) { |
| 84 | $this->type = $type; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * @param array $params |
| 89 | */ |
| 90 | public function setParams(array $params) { |
| 91 | $this->params = $params; |
| 92 | } |
| 93 | } |
| 94 |