OrganizationResponsability.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. namespace AppBundle\Entity\AccessAndFunction;
  3. use AppBundle\Annotation\DefaultField;
  4. use AppBundle\Entity\Traits\ActivityPeriodTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Dunglas\ApiBundle\Annotation\Iri;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use AppBundle\Entity\Traits\TimestampableEntity;
  10. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  11. /**
  12. * Responsibilité d'un Access au sein d'une Organization
  13. *
  14. * @Iri("http://schema.org/OrganizationResponsability")
  15. */
  16. #[ORM\Entity]
  17. class OrganizationResponsability
  18. {
  19. use TimestampableEntity;
  20. use CreatorUpdaterEntity;
  21. use ActivityPeriodTrait;
  22. /**
  23. * @var int
  24. */
  25. #[ORM\Column(type: 'integer')]
  26. #[ORM\Id]
  27. #[ORM\GeneratedValue(strategy: 'AUTO')]
  28. #[Groups(['organizationresponsability', 'access_details'])]
  29. private $id;
  30. /**
  31. * @var Access
  32. */
  33. #[ORM\ManyToOne(targetEntity: 'Access', inversedBy: 'organizationResponsabilities')]
  34. #[ORM\JoinColumn(nullable: false)]
  35. #[Assert\NotNull]
  36. #[Groups(['organizationresponsability'])]
  37. private $access;
  38. /**
  39. * @var string
  40. */
  41. #[ORM\Column(type: 'text', nullable: true)]
  42. #[Assert\Type(type: 'string')]
  43. #[Groups(['organizationresponsability', 'access_details_organizationresponsabilities'])]
  44. private $responsability;
  45. /**
  46. * @var bool
  47. */
  48. #[ORM\Column(type: 'boolean', options: ['default' => true])]
  49. #[Assert\Type(type: 'boolean')]
  50. #[Assert\NotNull]
  51. #[Groups(['organizationresponsability'])]
  52. private $isPhysical = true;
  53. /**
  54. * Sets id.
  55. *
  56. * @param int $id
  57. *
  58. * @return $this
  59. */
  60. public function setId($id)
  61. {
  62. $this->id = $id;
  63. return $this;
  64. }
  65. /**
  66. * Gets id.
  67. *
  68. * @return int
  69. */
  70. public function getId()
  71. {
  72. return $this->id;
  73. }
  74. /**
  75. * Set responsability
  76. *
  77. * @param string $responsability
  78. *
  79. * @return OrganizationResponsability
  80. */
  81. public function setResponsability($responsability)
  82. {
  83. $this->responsability = $responsability;
  84. return $this;
  85. }
  86. /**
  87. * Get responsability
  88. *
  89. * @return string
  90. */
  91. public function getResponsability()
  92. {
  93. return $this->responsability;
  94. }
  95. /**
  96. * Set access
  97. *
  98. * @param \AppBundle\Entity\AccessAndFunction\Access $access
  99. *
  100. * @return OrganizationResponsability
  101. */
  102. public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access)
  103. {
  104. $this->access = $access;
  105. return $this;
  106. }
  107. /**
  108. * Get access
  109. *
  110. * @return \AppBundle\Entity\AccessAndFunction\Access
  111. */
  112. public function getAccess()
  113. {
  114. return $this->access;
  115. }
  116. /**
  117. * Sets isPhysical.
  118. *
  119. * @param bool $isPhysical
  120. *
  121. * @return $this
  122. */
  123. public function setIsPhysical($isPhysical)
  124. {
  125. $this->isPhysical = $isPhysical;
  126. return $this;
  127. }
  128. /**
  129. * Gets isPhysical.
  130. *
  131. * @return bool
  132. */
  133. public function getIsPhysical()
  134. {
  135. return $this->isPhysical;
  136. }
  137. }