Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

51 lines
1.1KB

  1. <?php
  2. namespace App\Model;
  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. }