<?php

namespace App\Entity;

use App\Repository\BuyRepository;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass=BuyRepository::class)
 */
class Buy
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="datetime")
     */
    private $date;

    /**
     * @ORM\Column(type="string", length=255)
     */
    private $cle;
    /**
     * @ORM\Column(type="float", scale=2)
     */
    private $price;
    /**
     * @ORM\Column(type="boolean",options={"default":0})
     */
    private $statut;
    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Cource", inversedBy="Buy"))
     * @ORM\JoinColumn(
     *      name="cource_id",
     *      referencedColumnName="id",
     *      onDelete="SET NULL",
     *      nullable=true
     * )
     */
    private $Cource;
    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Participant", inversedBy="Buy"))
     * @ORM\JoinColumn(nullable=true)
     */
    private $Participant;
    public function __construct()
    {
        $this->date= new\DateTime('now');

    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getDate(): ?\DateTimeInterface
    {
        return $this->date;
    }

    public function setDate(\DateTimeInterface $date): self
    {
        $this->date = $date;

        return $this;
    }

    public function getCle(): ?string
    {
        return $this->cle;
    }

    public function setCle(string $cle): self
    {
        $this->cle = $cle;

        return $this;
    }

    /**
     * @return mixed
     */
    public function getCource()
    {
        return $this->Cource;
    }

    /**
     * @param mixed $Cource
     */
    public function setCource($Cource): void
    {
        $this->Cource = $Cource;
    }

    /**
     * @return mixed
     */
    public function getParticipant()
    {
        return $this->Participant;
    }

    /**
     * @param mixed $Participant
     */
    public function setParticipant($Participant): void
    {
        $this->Participant = $Participant;
    }

    /**
     * @return mixed
     */
    public function getStatut()
    {
        return $this->statut;
    }

    /**
     * @param mixed $statut
     */
    public function setStatut($statut): void
    {
        $this->statut = $statut;
    }

    /**
     * @return mixed
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * @param mixed $price
     */
    public function setPrice($price): void
    {
        $this->price = $price;
    }


}
