You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 line
1.1KB

  1. <?php
  2. namespace Lc\AdminBundle\Model\Cms;
  3. use App\IModel\UserInterface;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. trait BlameableTrait
  7. {
  8. /**
  9. * @Gedmo\Blameable(on="create")
  10. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  11. * @ORM\JoinColumn(nullable=false)
  12. */
  13. protected $createdBy;
  14. /**
  15. * @Gedmo\Blameable(on="update")
  16. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  17. * @ORM\JoinColumn(nullable=false)
  18. */
  19. protected $updatedBy;
  20. public function getCreatedBy(): ?UserInterface
  21. {
  22. return $this->createdBy;
  23. }
  24. public function setCreatedBy(?UserInterface $createdBy): self
  25. {
  26. $this->createdBy = $createdBy;
  27. return $this;
  28. }
  29. public function getUpdatedBy(): ?UserInterface
  30. {
  31. return $this->updatedBy;
  32. }
  33. public function setUpdatedBy(?UserInterface $updatedBy): self
  34. {
  35. $this->updatedBy = $updatedBy;
  36. return $this;
  37. }
  38. }