| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <?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;
- /**
- * Caractéristiques d'une Organization
- * (produits, options...etc)
- *
- * @Iri("http://schema.org/Settings")
- */
- #[ORM\Entity]
- class Settings
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['settings', 'organization_params_list'])]
- private $id;
- /**
- * @var Organization
- */
- #[ORM\OneToOne(targetEntity: 'Organization', inversedBy: 'settings', fetch: 'EAGER')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['settings'])]
- private $organization;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: false, options: ['default' => 'school'])]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Organization\SettingCountryEnum', 'toArray'], message: 'invalid-choice')]
- #[Groups(['settings', 'organization_params_list_settings'])]
- private $product = 'school';
- /**
- * @var string
- */
- #[ORM\Column(type: 'json_array', nullable: true)]
- #[Groups(['settings', 'organization_params_list_settings'])]
- private $modules;
- /**
- * @var string
- */
- #[ORM\Column(type: 'json_array', nullable: true)]
- #[Groups(['settings'])]
- private $actions;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true, options: ['default' => 'FRANCE'])]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Organization\SettingCountryEnum', 'toArray'], message: 'invalid-choice')]
- #[Groups(['settings'])]
- private $country = 'FRANCE';
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Sets organization.
- *
- * @param Organization $organization
- *
- * @return $this
- */
- public function setOrganization(Organization $organization)
- {
- $this->organization = $organization;
- return $this;
- }
- /**
- * Gets organization.
- *
- * @return Organization
- */
- public function getOrganization()
- {
- return $this->organization;
- }
- /**
- * Sets product.
- *
- * @param string $product
- *
- * @return $this
- */
- public function setProduct($product)
- {
- $this->product = $product;
- return $this;
- }
- /**
- * Gets product.
- *
- * @return string
- */
- public function getProduct()
- {
- return $this->product;
- }
- /**
- * Sets modules.
- *
- * @param array $modules
- *
- * @return $this
- */
- public function setModules(array $modules)
- {
- $this->modules = $modules;
- return $this;
- }
- /**
- * Gets modules.
- *
- * @return array
- */
- public function getModules()
- {
- return $this->modules;
- }
- /**
- * Sets actions.
- *
- * @param array $actions
- *
- * @return $this
- */
- public function setActions(array $actions)
- {
- $this->actions = $actions;
- return $this;
- }
- /**
- * Gets actions.
- *
- * @return array
- */
- public function getActions()
- {
- return $this->actions;
- }
- /**
- * Set country
- *
- * @param string $country
- *
- * @return Settings
- */
- public function setCountry($country)
- {
- $this->country = $country;
- return $this;
- }
- /**
- * Get country
- *
- * @return string
- */
- public function getCountry()
- {
- return $this->country;
- }
- }
|