|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Lc\ShopBundle\Context\UserInterface;
-
- /**
- * @ORM\MappedSuperclass
- */
- abstract class AbstractEntity
- {
- protected $errors;
-
- /**
- * @ORM\Column(type="datetime")
- * @Gedmo\Timestampable(on="create")
- */
- protected $createdAt;
-
- /**
- * @ORM\Column(type="datetime")
- * @Gedmo\Timestampable(on="update")
- */
- protected $updatedAt;
-
- /**
- * @Gedmo\Blameable(on="create")
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $createdBy;
-
- /**
- * @Gedmo\Blameable(on="update")
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $updatedBy;
-
-
- public function addError($message, $domain = 'lcshop', $params = []){
- $this->errors[] = array(
- 'message'=> $message,
- 'domain'=> $domain,
- 'params'=>$params
- );
- return $this->errors;
- }
- public function getErrors(){
- return $this->errors;
- }
-
- public function getCreatedAt(): ?\DateTimeInterface
- {
- return $this->createdAt;
- }
-
- public function setCreatedAt(\DateTimeInterface $createdAt): self
- {
- $this->createdAt = $createdAt;
-
- return $this;
- }
-
- public function getUpdatedAt(): ?\DateTimeInterface
- {
- return $this->updatedAt;
- }
-
- public function setUpdatedAt(\DateTimeInterface $updatedAt): self
- {
- $this->updatedAt = $updatedAt;
-
- return $this;
- }
-
- public function getCreatedBy(): ?UserInterface
- {
- return $this->createdBy;
- }
-
- public function setCreatedBy(?UserInterface $createdBy): self
- {
- $this->createdBy = $createdBy;
-
- return $this;
- }
-
- public function getUpdatedBy(): ?UserInterface
- {
- return $this->updatedBy;
- }
-
- public function setUpdatedBy(?UserInterface $updatedBy): self
- {
- $this->updatedBy = $updatedBy;
-
- return $this;
- }
-
-
- }
|