<?php

namespace AppBundle\Entity\Billing;


use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Serializer\Annotation\Groups;
use AppBundle\Annotation\DefaultField;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;

/**
 * Fais le lien entre l'Access qui règle la facture et l'Access ou
 * l'EducationalProject concerné par la facture
 * Classe de base de @see  AccessPayer, EducationalProjectPayer
 *
 * @Iri("http://schema.org/BillingPayer")
 */
#[ORM\Entity]
#[ORM\Table(name: 'BillingPayer')]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
#[ORM\DiscriminatorMap(['access' => 'AccessPayer', 'educationalproject' => 'EducationalProjectPayer'])]
abstract class AbstractBillingPayer
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['accesspayer', 'educationalprojectpayer', 'access_details', 'student_registration', 'educationalproject_details', 'payer_list', 'accessbilling_edit'])]
    private $id;
    /**
     * @var float
     */
    #[ORM\Column(type: 'float', nullable: false)]
    #[Assert\Type(type: 'float')]
    #[Assert\NotNull]
    #[Groups(['accesspayer', 'educationalprojectpayer', 'access_details_billingpayers', 'student_registration_billingreceivers', 'educationalproject_details_billingreceivers', 'payer_list_billingpayers', 'accessbilling_edit_billingreceivers', 'accessbilling_edit_billingpayers', 'accessbilling_edit_billingeducationalprojectpayers'])]
    private $paymentPart;
    /**
     * 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 paymentPart
     *
     * @param float $paymentPart
     *
     * @return AbstractBillingPayer
     */
    public function setPaymentPart($paymentPart)
    {
        $this->paymentPart = floatval($paymentPart);

        return $this;
    }
    /**
     * Get paymentPart
     *
     * @return float
     */
    public function getPaymentPart()
    {
        return $this->paymentPart;
    }
}
