<?php
namespace App\Entity\Statements;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints AS Constraints;
use Symfony\Component\Validator\Constraints AS Assert;
use Doctrine\ORM\Mapping AS ORM;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Lazy\LazyUuidFromString;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use App\Entity\BaseEntity;
use App\Entity\Landlords\Landlord;
use App\Entity\Maintenance\Maintenance;
use App\Entity\Properties\Property;
/**
* @ORM\Entity(repositoryClass="App\Repository\Statements\ItemRepository")
* @ORM\Table(name="statements_item")
*/
class Item extends BaseEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="uuid")
* @Assert\Uuid
*/
protected $uuid;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=false)
* @Assert\Type("\DateTime")
*/
private $created;
/**
* @ORM\Column(type="integer", nullable=false, length="2")
*/
private $type;
/**
* @ORM\Column(type="string", nullable=false, length="200")
*/
private $description;
/**
* @ORM\Column(type="integer", nullable=false, length="10")
*/
private $creditAmount;
/**
* @ORM\Column(type="integer", nullable=false, length="10")
*/
private $feeAmount;
/**
* @ORM\Column(type="integer", nullable=false, length="10")
*/
private $costAmount;
/**
* @ORM\Column(type="integer", nullable=false, length="10")
*/
private $VATAmount;
/**
* @ORM\Column(type="integer", nullable=false, length="5")
*/
private $VATRate;
/**
* @ORM\ManyToOne(targetEntity=Statement::class, inversedBy="items")
* @ORM\JoinColumn(nullable=false)
**/
private $statement;
/**
* @ORM\ManyToOne(targetEntity=Property::class, inversedBy="statementItems")
* @ORM\JoinColumn(nullable=false)
**/
private $property;
/**
* @ORM\OneToOne(targetEntity=Maintenance::class, inversedBy="statementItem")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
**/
private $maintenance;
public function __construct(array $defaults = array())
{
// Defaults
$this->setUuid(Uuid::uuid4());
$this->setCreated(new \DateTime());
$this->creditAmount = 0;
$this->feeAmount = 0;
$this->costAmount = 0;
$this->VATAmount = 0;
$this->VATRate = 0;
parent::__construct($defaults);
}
public function __toString()
{
return $this->getId();
}
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): LazyUuidFromString
{
return $this->uuid;
}
public function setUuid(LazyUuidFromString $uuid): void
{
$this->uuid = $uuid;
}
public function setCreated(\DateTime $created): void
{
$this->created = $created;
}
public function getCreated(): \DateTime
{
return $this->created;
}
public function getType()
{
return $this->type;
}
public function setType(int $type)
{
$this->type = $type;
}
public function getStatement()
{
return $this->statement;
}
public function setStatement(Statement $statement)
{
$this->statement = $statement;
}
public function getProperty()
{
return $this->property;
}
public function setProperty(Property $property)
{
$this->property = $property;
}
public function getMaintenance()
{
return $this->maintenance;
}
public function setMaintenance(Maintenance $maintenance)
{
$this->maintenance = $maintenance;
}
public function getCreditAmount()
{
return $this->creditAmount;
}
public function setCreditAmount(int $creditAmount)
{
$this->creditAmount = $creditAmount;
}
public function getFeeAmount()
{
return $this->feeAmount;
}
public function setFeeAmount(int $feeAmount)
{
$this->feeAmount = $feeAmount;
}
public function getCostAmount()
{
return $this->costAmount;
}
public function setCostAmount(int $costAmount)
{
$this->costAmount = $costAmount;
}
public function getDescription()
{
return $this->description;
}
public function setDescription(string $description)
{
$this->description = $description;
}
public function getVATAmount()
{
return $this->VATAmount;
}
public function setVATAmount(int $VATAmount)
{
$this->VATAmount = $VATAmount;
}
public function getVATRate()
{
return $this->VATRate;
}
public function setVATRate(int $VATRate)
{
$this->VATRate = $VATRate;
}
}