<?php

namespace AppBundle\Entity\Billing;

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;

/**
 * Zone de résidence d'un Access, telle que définie par l'Organization
 *
 * @Iri("http://schema.org/ResidenceArea")
 */
#[ORM\Entity]
class ResidenceArea
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['residencearea', 'accesses_list_accessbilling'])]
    private $id;
    /**
     * @var BillingSetting
     */
    #[ORM\ManyToOne(targetEntity: 'BillingSetting', inversedBy: 'residenceAreas')]
    #[ORM\JoinColumn(nullable: false)]
    #[Assert\NotNull]
    #[Groups(['residencearea'])]
    private $billingSetting;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string')]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Groups(['residencearea', 'residencearea_reference', 'access_details_accessbilling', 'accesses_list_accessbilling', 'student_list_accessbilling', 'guardians_list_accessbilling', 'adherent_list_accessbilling', 'payer_list_accessbilling', 'fusion_accesses_accessbilling'])]
    private $label;
    /**
     * @var ArrayCollection<AccessBilling>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessBilling', mappedBy: 'residenceArea')]
    #[Groups(['residencearea_accessbilling'])]
    private $accessBilling;
    /**
     * @var ArrayCollection<IntangibleDiscountDetail>
     */
    #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Product\IntangibleDiscountDetail', mappedBy: 'residenceArea')]
    #[Groups(['residencearea_intangiblediscountdetail'])]
    private $intangibleDiscountDetails;
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->accessBilling = new ArrayCollection();
        $this->intangibleDiscountDetails = new ArrayCollection();
    }
    /**
     * 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;
    }
    /**
     * Set label
     *
     * @param string $label
     *
     * @return ResidenceArea
     */
    public function setLabel($label)
    {
        $this->label = $label;

        return $this;
    }
    /**
     * Get label
     *
     * @return string
     */
    public function getLabel()
    {
        return $this->label;
    }
    /**
     * Set billingSetting
     *
     * @param \AppBundle\Entity\Billing\BillingSetting $billingSetting
     *
     * @return ResidenceArea
     */
    public function setBillingSetting(\AppBundle\Entity\Billing\BillingSetting $billingSetting)
    {
        $this->billingSetting = $billingSetting;

        return $this;
    }
    /**
     * Get billingSetting
     *
     * @return \AppBundle\Entity\Billing\BillingSetting
     */
    public function getBillingSetting()
    {
        return $this->billingSetting;
    }
    /**
     * Add accessBilling
     *
     * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling
     *
     * @return ResidenceArea
     */
    public function addAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling)
    {
        $this->accessBilling[] = $accessBilling;

        return $this;
    }
    /**
     * Remove accessBilling
     *
     * @param \AppBundle\Entity\Billing\AccessBilling $accessBilling
     */
    public function removeAccessBilling(\AppBundle\Entity\Billing\AccessBilling $accessBilling)
    {
        $this->accessBilling->removeElement($accessBilling);
    }
    /**
     * Get accessBilling
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAccessBilling()
    {
        return $this->accessBilling;
    }
    /**
     * Add intangibleDiscountDetail
     *
     * @param \AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail
     *
     * @return ResidenceArea
     */
    public function addIntangibleDiscountDetail(\AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail)
    {
        $this->intangibleDiscountDetails[] = $intangibleDiscountDetail;

        return $this;
    }
    /**
     * Remove intangibleDiscountDetail
     *
     * @param \AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail
     */
    public function removeIntangibleDiscountDetail(\AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail)
    {
        $this->intangibleDiscountDetails->removeElement($intangibleDiscountDetail);
    }
    /**
     * Get intangibleDiscountDetails
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getIntangibleDiscountDetails()
    {
        return $this->intangibleDiscountDetails;
    }
}
