<?php

namespace AppBundle\Entity\Booking;

use AppBundle\Entity\AccessAndFunction\Access;
use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Serializer\Annotation\Groups;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;

/**
 *
 * Travail à faire pour un cours par un utilisateur
 *
 * @Iri("http://schema.org/WorkByUser")
 */
#[ORM\Entity]
class WorkByUser
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['workbyuser', 'worksbyusers_db'])]
    private $id;
    /**
     * @var Work
     */
    #[ORM\ManyToOne(targetEntity: 'Work', inversedBy: 'workByUsers')]
    #[Groups(['workbyuser', 'worksbyusers_db'])]
    private $work;
    /**
     * @var Work
     */
    #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'workByUsers')]
    #[Groups(['workbyuser'])]
    private $student;
    /**
     * @var boolean
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Groups(['workbyuser', 'worksbyusers_db'])]
    private $isDone=false;
    /**
     * 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 work.
     *
     * @param Work $work
     *
     * @return $this
     */
    public function setWork(Work $work = null)
    {
        $this->work = $work;

        return $this;
    }
    /**
     * Gets work.
     *
     * @return Work
     */
    public function getWork()
    {
        return $this->work;
    }
    /**
     * Sets student.
     *
     * @param Access $student
     *
     * @return $this
     */
    public function setStudent(Access $student = null)
    {
        $this->student = $student;

        return $this;
    }
    /**
     * Gets student.
     *
     * @return Access
     */
    public function getStudent()
    {
        return $this->student;
    }
    /**
     * Sets isDone.
     *
     * @param boolean $isDone
     *
     * @return $this
     */
    public function setIsDone($isDone)
    {
        $this->isDone = $isDone;

        return $this;
    }
    /**
     * Gets isDone.
     *
     * @return boolean
     */
    public function getIsDone()
    {
        return $this->isDone;
    }
}