Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

91 lines
2.0KB

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