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
LogEntity.php
108 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Entities; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use DateTimeInterface; |
| 9 | use MailPoet\Doctrine\EntityTraits\AutoincrementedIdTrait; |
| 10 | use MailPoet\Doctrine\EntityTraits\CreatedAtTrait; |
| 11 | use MailPoetVendor\Doctrine\ORM\Mapping as ORM; |
| 12 | |
| 13 | /** |
| 14 | * @ORM\Entity() |
| 15 | * @ORM\Table(name="log") |
| 16 | */ |
| 17 | class LogEntity { |
| 18 | use AutoincrementedIdTrait; |
| 19 | use CreatedAtTrait; |
| 20 | |
| 21 | /** |
| 22 | * @ORM\Column(type="string", nullable=true) |
| 23 | * @var string|null |
| 24 | */ |
| 25 | private $name; |
| 26 | |
| 27 | /** |
| 28 | * @ORM\Column(type="integer", nullable=true) |
| 29 | * @var int|null |
| 30 | */ |
| 31 | private $level; |
| 32 | |
| 33 | /** |
| 34 | * @ORM\Column(type="string", nullable=true) |
| 35 | * @var string|null |
| 36 | */ |
| 37 | private $message; |
| 38 | |
| 39 | /** |
| 40 | * @ORM\Column(type="string", nullable=true) |
| 41 | * @var string|null |
| 42 | */ |
| 43 | private $rawMessage; |
| 44 | |
| 45 | |
| 46 | /** |
| 47 | * @ORM\Column(type="string", nullable=true) |
| 48 | * @var string|null |
| 49 | */ |
| 50 | private $context; |
| 51 | |
| 52 | /** |
| 53 | * @return string|null |
| 54 | */ |
| 55 | public function getName(): ?string { |
| 56 | return $this->name; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @return int|null |
| 61 | */ |
| 62 | public function getLevel(): ?int { |
| 63 | return $this->level; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @return string|null |
| 68 | */ |
| 69 | public function getMessage(): ?string { |
| 70 | return $this->message; |
| 71 | } |
| 72 | |
| 73 | public function getRawMessage(): ?string { |
| 74 | return $this->rawMessage; |
| 75 | } |
| 76 | |
| 77 | public function getContext(): ?array { |
| 78 | return (array)json_decode($this->context ?? '{}', true); |
| 79 | } |
| 80 | |
| 81 | public function setName(?string $name): void { |
| 82 | $this->name = $name; |
| 83 | } |
| 84 | |
| 85 | public function setLevel(?int $level): void { |
| 86 | $this->level = $level; |
| 87 | } |
| 88 | |
| 89 | public function setMessage(?string $message): void { |
| 90 | $this->message = $message; |
| 91 | } |
| 92 | |
| 93 | public function setCreatedAt(DateTimeInterface $createdAt): void { |
| 94 | $this->createdAt = $createdAt; |
| 95 | } |
| 96 | |
| 97 | public function setRawMessage(string $message): void { |
| 98 | $this->rawMessage = $message; |
| 99 | } |
| 100 | |
| 101 | public function setContext(array $context): void { |
| 102 | $str = json_encode($context); |
| 103 | if ($str) { |
| 104 | $this->context = $str; |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 |