| @@ -1,20 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * @copyright © TMS-Plugins. All rights reserved. | |
| 4 | + * @copyright © Melograno Venture Studio. All rights reserved. | |
| 5 | 5 | * @licence See LICENCE.md for license details. |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace IvyForms\Entity\Entry; |
| 9 | 9 | |
| 10 | -// phpcs:disable PSR1.Files.SideEffects | |
| 11 | -if (!defined('ABSPATH')) { | |
| 12 | - exit; // Exit if accessed directly | |
| 13 | -} | |
| 14 | - | |
| 15 | -use IvyForms\Entity\EntryField\EntryField; | |
| 16 | -use IvyForms\Repository\Entry\EntryHelper; | |
| 10 | +use IvyForms\Common\Helpers\EntryHelper; | |
| 17 | 11 | use IvyForms\ValueObjects\Entry\Entry as EntryValueObject; |
| 18 | 12 | |
| 19 | 13 | /** |
| 20 | 14 | * Class Entry |
| @@ -110,8 +104,18 @@ | ||
| 110 | 104 | return $this->entry->getDateCreated(); |
| 111 | 105 | } |
| 112 | 106 | |
| 113 | 107 | /** |
| 108 | + * Set the date the entry was created. | |
| 109 | + * | |
| 110 | + * @param string $dateCreated The persisted creation timestamp. | |
| 111 | + */ | |
| 112 | + public function setDateCreated(string $dateCreated): void | |
| 113 | + { | |
| 114 | + $this->entry->dateCreated = $dateCreated; | |
| 115 | + } | |
| 116 | + | |
| 117 | + /** | |
| 114 | 118 | * Get the date the entry was last edited. |
| 115 | 119 | * |
| 116 | 120 | * @return string|null The date the entry was last edited or null if not set. |
| 117 | 121 | */ |
| @@ -117,8 +121,18 @@ | ||
| 117 | 121 | */ |
| 118 | 122 | public function getDateEdited(): ?string |
| 119 | 123 | { |
| 120 | 124 | return $this->entry->getDateEdited(); |
| 125 | + } | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * Set the date the entry was last edited. | |
| 129 | + * | |
| 130 | + * @param string $dateEdited The persisted last-edited timestamp. | |
| 131 | + */ | |
| 132 | + public function setDateEdited(string $dateEdited): void | |
| 133 | + { | |
| 134 | + $this->entry->dateEdited = $dateEdited; | |
| 121 | 135 | } |
| 122 | 136 | |
| 123 | 137 | /** |
| 124 | 138 | * Get the status of the entry. |