<?php

namespace AppBundle\Entity\AccessAndFunction;

use AppBundle\Entity\AccessAndFunction\Access;
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;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use AppBundle\Validator\Constraints\Access as OpentalentAssert;

/**
 * Paramètres d'abonnement à la com pour un Access
 *
 * @Iri("http://schema.org/AccessCommunication")
 */
#[ORM\Entity]
class AccessCommunication
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    //INSERT INTO AccessCommunication (access_id, culturalNewsletter, adminNewsletter, userNewsletter, opentalentBusinessNewsletter, partnerBusinessNewsletter)
    //SELECT Access.id as accessId, true,true,true,true,false
    //FROM Access
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['accesscommunication'])]
    private $id;
    /**
     * @var Access
     */
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'accessCommunication', cascade: ['persist'], fetch: 'EAGER')]
    #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
    #[Groups(['accesscommunication'])]
    private $access;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => true])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesscommunication'])]
    private $culturalNewsletter = true;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => true])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesscommunication'])]
    private $adminNewsletter = true;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => true])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesscommunication'])]
    private $userNewsletter = true;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => true])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesscommunication'])]
    private $opentalentBusinessNewsletter = true;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['accesscommunication'])]
    private $partnerBusinessNewsletter = false;
    /**
     * The constructor
     */
    public function __construct() {

    }
    /**
     * 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 culturalNewsletter
     *
     * @param boolean $culturalNewsletter
     *
     * @return AccessCommunication
     */
    public function setCulturalNewsletter($culturalNewsletter)
    {
        $this->culturalNewsletter = $culturalNewsletter;

        return $this;
    }
    /**
     * Get culturalNewsletter
     *
     * @return boolean
     */
    public function getCulturalNewsletter()
    {
        return $this->culturalNewsletter;
    }
    /**
     * Set adminNewsletter
     *
     * @param boolean $adminNewsletter
     *
     * @return AccessCommunication
     */
    public function setAdminNewsletter($adminNewsletter)
    {
        $this->adminNewsletter = $adminNewsletter;

        return $this;
    }
    /**
     * Get adminNewsletter
     *
     * @return boolean
     */
    public function getAdminNewsletter()
    {
        return $this->adminNewsletter;
    }
    /**
     * Set partnerBusinessNewsletter
     *
     * @param boolean $partnerBusinessNewsletter
     *
     * @return AccessCommunication
     */
    public function setPartnerBusinessNewsletter($partnerBusinessNewsletter)
    {
        $this->partnerBusinessNewsletter = $partnerBusinessNewsletter;

        return $this;
    }
    /**
     * Get partnerBusinessNewsletter
     *
     * @return boolean
     */
    public function getPartnerBusinessNewsletter()
    {
        return $this->partnerBusinessNewsletter;
    }
    /**
     * Set access
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $access
     *
     * @return AccessCommunication
     */
    public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access = null)
    {
        $this->access = $access;

        return $this;
    }
    /**
     * Get access
     *
     * @return \AppBundle\Entity\AccessAndFunction\Access
     */
    public function getAccess()
    {
        return $this->access;
    }
    /**
     * Set userNewsletter
     *
     * @param boolean $userNewsletter
     *
     * @return AccessCommunication
     */
    public function setUserNewsletter($userNewsletter)
    {
        $this->userNewsletter = $userNewsletter;

        return $this;
    }
    /**
     * Get userNewsletter
     *
     * @return boolean
     */
    public function getUserNewsletter()
    {
        return $this->userNewsletter;
    }
    /**
     * Set opentalentBusinessNewsletter
     *
     * @param boolean $opentalentBusinessNewsletter
     *
     * @return AccessCommunication
     */
    public function setOpentalentBusinessNewsletter($opentalentBusinessNewsletter)
    {
        $this->opentalentBusinessNewsletter = $opentalentBusinessNewsletter;

        return $this;
    }
    /**
     * Get opentalentBusinessNewsletter
     *
     * @return boolean
     */
    public function getOpentalentBusinessNewsletter()
    {
        return $this->opentalentBusinessNewsletter;
    }
}
