Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit bdf262d

Browse files
author
Tito Costa
committed
added a created at value to the entity
1 parent 0c6d64d commit bdf262d

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

Entity/FormErrorLog.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
/**
99
* @ORM\Table(name="form_error_log")
10-
* @ORM\Entity
10+
* @ORM\Entity()
11+
* @ORM\HasLifecycleCallbacks()
1112
*/
1213
class FormErrorLog implements FormErrorLogEntityInterface
1314
{
@@ -55,6 +56,11 @@ class FormErrorLog implements FormErrorLogEntityInterface
5556
*/
5657
private $uri;
5758

59+
/**
60+
* @ORM\Column(type="datetime")
61+
*/
62+
private $createdAt;
63+
5864
public function getFormName()
5965
{
6066
return $this->form_name;
@@ -107,4 +113,24 @@ public function getUri()
107113
return $this->uri;
108114
}
109115

116+
public function getCreatedAt()
117+
{
118+
return $this->createdAt;
119+
}
120+
121+
public function setCreatedAt(\DateTime $createdAt)
122+
{
123+
$this->createdAt = $createdAt;
124+
125+
return $this;
126+
}
127+
128+
/**
129+
* @ORM\PrePersist
130+
*/
131+
public function setCreatedAtValue()
132+
{
133+
$this->createdAt = new \DateTime();
134+
}
135+
110136
}

0 commit comments

Comments
 (0)