File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,31 @@ class CronSchedule extends BaseCronSchedule
4646 * @ORM\Column(type="boolean")
4747 */
4848 protected $ enabled = true ;
49+
50+ /**
51+ * @ORM\Column(type="datetime")
52+ */
53+ protected $ createdAt ;
54+
55+ /**
56+ * @ORM\Column(type="datetime")
57+ */
58+ protected $ modifiedAt ;
59+
60+ /**
61+ * @ORM\PrePersist
62+ */
63+ public function prePersist ()
64+ {
65+ $ this ->createdAt = new \DateTime ();
66+ $ this ->modifiedAt = new \DateTime ();
67+ }
68+
69+ /**
70+ * @ORM\PreUpdate
71+ */
72+ public function preUpdate ()
73+ {
74+ $ this ->modifiedAt = new \DateTime ();
75+ }
4976}
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ class CronSchedule
2222 /** @var bool */
2323 protected $ enabled = true ;
2424
25+ /** @var \DateTime */
26+ protected $ createdAt ;
27+
28+ /** @var \DateTime */
29+ protected $ modifiedAt ;
30+
2531 /**
2632 * @return string
2733 */
@@ -135,4 +141,36 @@ public function setEnabled(bool $boolean = null): void
135141 {
136142 $ this ->enabled = (bool ) $ boolean ;
137143 }
144+
145+ /**
146+ * @return \DateTimeInterface
147+ */
148+ public function getCreatedAt (): \DateTimeInterface
149+ {
150+ return $ this ->createdAt ;
151+ }
152+
153+ /**
154+ * @param \DateTimeInterface $createdAt
155+ */
156+ public function setCreatedAt (\DateTimeInterface $ createdAt ): void
157+ {
158+ $ this ->createdAt = $ createdAt ;
159+ }
160+
161+ /**
162+ * @return \DateTimeInterface
163+ */
164+ public function getModifiedAt (): \DateTimeInterface
165+ {
166+ return $ this ->modifiedAt ;
167+ }
168+
169+ /**
170+ * @param \DateTimeInterface $modifiedAt
171+ */
172+ public function setModifiedAt (\DateTimeInterface $ modifiedAt ): void
173+ {
174+ $ this ->modifiedAt = $ modifiedAt ;
175+ }
138176}
You can’t perform that action at this time.
0 commit comments