<?php
namespace App\Entity\Expedient;
use App\Entity\AppUser;
use App\Entity\Shipping;
use App\Repository\Expedient\LogRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LogRepository::class)
* @ORM\Table(name="shipping_log")
*/
class Log
{
const OPERATION_CREATED = 'created';
const OPERATION_UPDATED = 'updated';
const OPERATION_CANCELLED = 'cancelled';
const OPERATION_DISCOUNT = 'discount';
const OPERATION_DISCOUNT_CANCEL = 'discount_canceled';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=AppUser::class, inversedBy="logs")
* @ORM\JoinColumn(nullable=false)
*/
private $generatedBy;
/**
* @ORM\Column(type="string", length=255)
*/
private $operation;
/**
* @ORM\Column(type="text")
*/
private $extraInfo;
/**
* @ORM\ManyToOne(targetEntity=Shipping::class, inversedBy="logs")
* @ORM\JoinColumn(nullable=false)
*/
private $shipping;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $operationAmount;
/**
* @ORM\Column(type="boolean")
*/
private $cancelledDiscount;
public function getId(): ?int
{
return $this->id;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getGeneratedBy(): ?AppUser
{
return $this->generatedBy;
}
public function setGeneratedBy(?AppUser $generatedBy): self
{
$this->generatedBy = $generatedBy;
return $this;
}
public function getOperation(): ?string
{
return $this->operation;
}
public function setOperation(string $operation): self
{
$this->operation = $operation;
return $this;
}
public function getExtraInfo(): ?string
{
return $this->extraInfo;
}
public function setExtraInfo(string $extraInfo): self
{
$this->extraInfo = $extraInfo;
return $this;
}
public function getShipping(): ?Shipping
{
return $this->shipping;
}
public function setShipping(?Shipping $shipping): self
{
$this->shipping = $shipping;
return $this;
}
public function getOperationAmount(): ?float
{
return $this->operationAmount;
}
public function setOperationAmount(?float $operationAmount): self
{
$this->operationAmount = $operationAmount;
return $this;
}
public function isCancelledDiscount(): ?bool
{
return $this->cancelledDiscount;
}
public function setCancelledDiscount(bool $cancelledDiscount): self
{
$this->cancelledDiscount = $cancelledDiscount;
return $this;
}
}