<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Traits\CreatedUpdatedTrait;
use JMS\Serializer\Annotation\Expose;
use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation\ExclusionPolicy;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Page
*
* @ORM\Table(name="v_access_code")
* @ORM\Entity(repositoryClass="App\Repository\AccessCodeRepository")
* @ExclusionPolicy("all")
* @Gedmo\Loggable
*/
class AccessCode
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Expose
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Clinic")
* @Assert\NotNull()
* @Gedmo\Versioned
*/
private $clinic;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=255, unique=true)
* @Expose
* @Gedmo\Versioned
*/
private $code;
/**
* @var boolean
*
* @ORM\Column(name="used", type="boolean")
* @Expose
* @Gedmo\Versioned
*/
private $used = true;
/**
* @var boolean
*
* @ORM\Column(name="enabled", type="boolean")
* @Expose
* @Gedmo\Versioned
*/
private $enabled = true;
/**
* @ORM\Column(type="text", name="note", nullable=true)
* @Gedmo\Versioned
*/
private $note;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", name="expiry_date", nullable=true)
* @Gedmo\Versioned
* @Expose
*/
private $expiryDate;
/**
* @var integer
*
* @ORM\Column(type="integer", name="active_duration", nullable=true)
* @Gedmo\Versioned
* @Expose
*/
private $activeDuration;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", name="used_date", nullable=true)
* @Gedmo\Versioned
* @Expose
*/
private $usedDate;
/**
* @var boolean
*
* @ORM\Column(name="assigned", type="boolean")
* @Expose
* @Gedmo\Versioned
*/
private $assigned = false;
use CreatedUpdatedTrait;
public function __toString()
{
return (string) $this->code;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getClinic()
{
return $this->clinic;
}
/**
* @param mixed $clinic
*/
public function setClinic($clinic): void
{
$this->clinic = $clinic;
}
/**
* @return string
*/
public function getCode(): ?string
{
return $this->code;
}
/**
* @param string $code
*/
public function setCode(string $code): void
{
$this->code = $code;
}
/**
* @return bool
*/
public function isUsed(): bool
{
return $this->used;
}
/**
* @param bool $used
*/
public function setUsed(bool $used): void
{
$this->used = $used;
}
/**
* @return bool
*/
public function isEnabled(): bool
{
return $this->enabled;
}
/**
* @param bool $enabled
*/
public function setEnabled(bool $enabled): void
{
$this->enabled = $enabled;
}
/**
* @return mixed
*/
public function getNote()
{
return $this->note;
}
/**
* @param mixed $note
*/
public function setNote($note): void
{
$this->note = $note;
}
/**
* @return \DateTime
*/
public function getExpiryDate(): ?\DateTime
{
return $this->expiryDate;
}
/**
* @param \DateTime $expiryDate
*/
public function setExpiryDate(?\DateTime $expiryDate): void
{
$this->expiryDate = $expiryDate;
}
/**
* @return int
*/
public function getActiveDuration(): ?int
{
return $this->activeDuration;
}
/**
* @param int $activeDuration
*/
public function setActiveDuration(?int $activeDuration): void
{
$this->activeDuration = $activeDuration;
}
/**
* @return \DateTime
*/
public function getUsedDate(): ?\DateTime
{
return $this->usedDate;
}
/**
* @param \DateTime $usedDate
*/
public function setUsedDate(?\DateTime $usedDate): void
{
$this->usedDate = $usedDate;
}
/**
* @return bool
*/
public function isAssigned(): ?bool
{
return $this->assigned;
}
/**
* @param bool $assigned
*/
public function setAssigned(?bool $assigned): void
{
$this->assigned = $assigned;
}
}