| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace AppBundle\Entity\Organization;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Types d'activités proposées par une structure
- *
- * @Iri("http://schema.org/Activity")
- */
- #[ORM\Entity]
- class TypeOfPractice
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['typeofpractice', 'network_list', 'typeofpractice_reference'])]
- private $id;
- /**
- * @var string The name of the item.
- */
- #[ORM\Column(type: 'string', nullable: false)]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Cotisation\TypeOfPracticeEnum', 'toArray'])]
- #[Groups(['typeofpractice', 'network_list_typeofpractices', 'typeofpractice_reference'])]
- private $name;
- /**
- * @var string The name of the item.
- */
- #[ORM\Column(type: 'string', nullable: false)]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Cotisation\CategoryTypeOfPracticeEnum', 'toArray'])]
- #[Groups(['typeofpractice', 'typeofpractice_reference'])]
- private $category;
- /**
- * @var ArrayCollection<Organization>
- */
- #[Assert\Valid]
- #[ORM\ManyToMany(targetEntity: 'Organization', mappedBy: 'typeOfPractices')]
- #[Groups(['typeofpractice'])]
- private $organization;
- public function __construct() {
- $this->organization = new ArrayCollection();
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Gets name.
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Gets category.
- *
- * @return string
- */
- public function getCategory()
- {
- return $this->category;
- }
- }
|