<?php
namespace App\Entity;
use App\Entity\Common\SoftDeletableEntityTrait;
use App\Entity\Common\StatefulEntityTrait;
use App\Entity\Common\TimestampedEntityTrait;
use Doctrine\ORM\Mapping\UniqueConstraint;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Evence\Bundle\SoftDeleteableExtensionBundle\Mapping\Annotation as Evence;
/**
* Class Insurance
*
* @ORM\Entity(repositoryClass="App\Repository\InsuranceRepository")
* @ORM\Table(indexes={
* @ORM\Index(name="IDX_updated_at", columns={"updated_at"}),
* @ORM\Index(name="IDX_deleted_at", columns={"deleted_at"}),
* @ORM\Index(name="IDX_is_active", columns={"is_active"}) *
* })
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*/
class Insurance
{
use SoftDeletableEntityTrait, StatefulEntityTrait, TimestampedEntityTrait;
/**
* @var integer
*
* @ORM\Id()
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var string
*
* @ORM\Column(length=100)
*/
private $name;
/**
* @var float
*
* @ORM\Column(type="decimal", precision=13, scale=4)
*/
private $price=0;
/**
* @ORM\ManyToOne(targetEntity="StaCurrency")
* @ORM\JoinColumn(name="currency_code", referencedColumnName="code", onDelete="CASCADE")
*/
private $currency;
public function getId(): int
{
return $this->id;
}
public function setId(int $id): Insurance
{
$this->id = $id;
return $this;
}
public function getName(): string
{
return $this->name;
}
public function setName(string $name): Insurance
{
$this->name = $name;
return $this;
}
/**
* @return float|int
*/
public function getPrice()
{
return $this->price;
}
/**
* @param float|int $price
* @return Insurance
*/
public function setPrice($price)
{
$this->price = $price;
return $this;
}
/**
* @return mixed
*/
public function getCurrency()
{
return $this->currency;
}
/**
* @param mixed $currency
* @return Insurance
*/
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}
}