CreatorUpdaterEntity.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. namespace AppBundle\Entity\Traits;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Dunglas\ApiBundle\Annotation\Iri;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8. * @Iri("http://schema.org/Generic")
  9. */
  10. trait CreatorUpdaterEntity
  11. {
  12. /**
  13. * @var int
  14. */
  15. #[ORM\Column(type: 'integer', nullable: true)]
  16. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  17. #[Groups(['organizationresponsability', 'person', 'networkorganization', 'organizationfunction', 'educationnotation'])]
  18. private $legacyId;
  19. /**
  20. * @var int
  21. */
  22. #[ORM\Column(type: 'integer', nullable: true)]
  23. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  24. private $createdBy;
  25. /**
  26. * @var int
  27. */
  28. #[ORM\Column(type: 'integer', nullable: true)]
  29. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  30. private $updatedBy;
  31. /**
  32. * @var bool
  33. */
  34. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  35. #[Assert\Type(type: 'boolean')]
  36. #[Assert\NotNull]
  37. private $draft = false;
  38. /**
  39. * Sets legacyId.
  40. *
  41. * @param int $legacyId
  42. *
  43. * @return $this
  44. */
  45. public function setLegacyId($legacyId)
  46. {
  47. $this->legacyId = $legacyId;
  48. return $this;
  49. }
  50. /**
  51. * Gets legacyId.
  52. *
  53. * @return int
  54. */
  55. public function getLegacyId()
  56. {
  57. return $this->legacyId;
  58. }
  59. /**
  60. * Sets createdBy.
  61. *
  62. * @param int $createdBy
  63. *
  64. * @return $this
  65. */
  66. public function setCreatedBy($createdBy)
  67. {
  68. $this->createdBy = $createdBy;
  69. return $this;
  70. }
  71. /**
  72. * Gets createdBy.
  73. *
  74. * @return int
  75. */
  76. public function getCreatedBy()
  77. {
  78. return $this->createdBy;
  79. }
  80. /**
  81. * Sets updatedBy.
  82. *
  83. * @param int $updatedBy
  84. *
  85. * @return $this
  86. */
  87. public function setUpdatedBy($updatedBy)
  88. {
  89. $this->updatedBy = $updatedBy;
  90. return $this;
  91. }
  92. /**
  93. * Gets updatedBy.
  94. *
  95. * @return int
  96. */
  97. public function getUpdatedBy()
  98. {
  99. return $this->updatedBy;
  100. }
  101. /**
  102. * Sets draft.
  103. *
  104. * @param bool $draft
  105. *
  106. * @return $this
  107. */
  108. public function setDraft($draft)
  109. {
  110. $this->draft = $draft;
  111. return $this;
  112. }
  113. /**
  114. * Gets draft.
  115. *
  116. * @return bool
  117. */
  118. public function getDraft()
  119. {
  120. return $this->draft;
  121. }
  122. /**
  123. * NEED THIS FOR ELASTICA TRANSLATABLE
  124. * @return null
  125. */
  126. public function getTranslatable(){
  127. return null;
  128. }
  129. /**
  130. * NEED THIS FOR ELASTICA TRANSLATABLE
  131. * @return null
  132. */
  133. public function getPhoneNumberType(){
  134. return null;
  135. }
  136. }