選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

90 行
1.9KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Lc\ShopBundle\Context\UserInterface;
  6. /**
  7. * @ORM\MappedSuperclass
  8. */
  9. abstract class AbstractEntity
  10. {
  11. /**
  12. * @ORM\Column(type="datetime")
  13. * @Gedmo\Timestampable(on="create")
  14. */
  15. protected $createdAt;
  16. /**
  17. * @ORM\Column(type="datetime")
  18. * @Gedmo\Timestampable(on="update")
  19. */
  20. protected $updatedAt;
  21. /**
  22. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
  23. * @ORM\JoinColumn(nullable=false)
  24. */
  25. protected $createdBy;
  26. /**
  27. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
  28. * @ORM\JoinColumn(nullable=false)
  29. */
  30. protected $updatedBy;
  31. public function getCreatedAt(): ?\DateTimeInterface
  32. {
  33. return $this->createdAt;
  34. }
  35. public function setCreatedAt(\DateTimeInterface $createdAt): self
  36. {
  37. $this->createdAt = $createdAt;
  38. return $this;
  39. }
  40. public function getUpdatedAt(): ?\DateTimeInterface
  41. {
  42. return $this->updatedAt;
  43. }
  44. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  45. {
  46. $this->updatedAt = $updatedAt;
  47. return $this;
  48. }
  49. public function getCreatedBy(): ?UserInterface
  50. {
  51. return $this->createdBy;
  52. }
  53. public function setCreatedBy(?UserInterface $createdBy): self
  54. {
  55. $this->createdBy = $createdBy;
  56. return $this;
  57. }
  58. public function getUpdatedBy(): ?UserInterface
  59. {
  60. return $this->updatedBy;
  61. }
  62. public function setUpdatedBy(?UserInterface $updatedBy): self
  63. {
  64. $this->updatedBy = $updatedBy;
  65. return $this;
  66. }
  67. }