<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\GastoRepository")
* @ORM\Table(name="gasto", schema="perseo")
* @ORM\EntityListeners({"App\EntityListener\Gasto\CalcularPrecioTotalRelojListener"})
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class Gasto
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="float", nullable=false, precision=2, options={"default":"0.00"})
*/
protected $precio;
/**
* @ORM\Column(type="text", nullable=true)
*/
protected $descripcion;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
protected $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
protected $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
protected $createdAt;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\TipoCargoAbstract", inversedBy="gastos")
* @ORM\JoinColumn(name="tipo_cargo_id", referencedColumnName="id")
*/
protected $tipoCargo;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Reloj", inversedBy="gastos")
* @ORM\JoinColumn(name="reloj_id", referencedColumnName="id", nullable=false)
*/
protected $reloj;
public function getId(): ?string
{
return $this->id;
}
public function getPrecio(): ?float
{
return $this->precio;
}
public function setPrecio(float $precio): self
{
$this->precio = $precio;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): self
{
$this->descripcion = $descripcion;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getTipoCargo(): ?TipoCargoAbstract
{
return $this->tipoCargo;
}
public function setTipoCargo(?TipoCargoAbstract $tipoCargo): self
{
$this->tipoCargo = $tipoCargo;
return $this;
}
public function getReloj(): ?Reloj
{
return $this->reloj;
}
public function setReloj(?Reloj $reloj): self
{
$this->reloj = $reloj;
return $this;
}
}