<?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;
    }
}
