Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AbstractEntity.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. }