src/Entity/Statements/Item.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Statements;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Symfony\Component\Validator\Constraints AS Constraints;
  5. use Symfony\Component\Validator\Constraints AS Assert;
  6. use Doctrine\ORM\Mapping AS ORM;
  7. use Ramsey\Uuid\Uuid;
  8. use Ramsey\Uuid\Lazy\LazyUuidFromString;
  9. use Symfony\Component\Security\Core\User\UserInterface;
  10. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  11. use App\Entity\BaseEntity;
  12. use App\Entity\Landlords\Landlord;
  13. use App\Entity\Maintenance\Maintenance;
  14. use App\Entity\Properties\Property;
  15. /**
  16.  * @ORM\Entity(repositoryClass="App\Repository\Statements\ItemRepository")
  17.  * @ORM\Table(name="statements_item")
  18.  */
  19. class Item extends BaseEntity
  20. {
  21.     /**
  22.     * @ORM\Id
  23.     * @ORM\GeneratedValue(strategy="AUTO")
  24.     * @ORM\Column(type="integer")
  25.     */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="uuid")
  29.      * @Assert\Uuid
  30.      */
  31.     protected $uuid;
  32.     /**
  33.      * @var \DateTime
  34.      *
  35.      * @ORM\Column(type="datetime", nullable=false)
  36.      * @Assert\Type("\DateTime")
  37.      */
  38.     private $created;
  39.     /**
  40.     * @ORM\Column(type="integer", nullable=false, length="2")
  41.     */
  42.     private $type;
  43.     /**
  44.     * @ORM\Column(type="string", nullable=false, length="200")
  45.     */
  46.     private $description;
  47.     /**
  48.     * @ORM\Column(type="integer", nullable=false, length="10")
  49.     */
  50.     private $creditAmount;
  51.     /**
  52.     * @ORM\Column(type="integer", nullable=false, length="10")
  53.     */
  54.     private $feeAmount;
  55.     /**
  56.     * @ORM\Column(type="integer", nullable=false, length="10")
  57.     */
  58.     private $costAmount;
  59.     /**
  60.     * @ORM\Column(type="integer", nullable=false, length="10")
  61.     */
  62.     private $VATAmount;
  63.     /**
  64.     * @ORM\Column(type="integer", nullable=false, length="5")
  65.     */
  66.     private $VATRate;
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity=Statement::class, inversedBy="items")
  69.      * @ORM\JoinColumn(nullable=false)
  70.      **/
  71.     private $statement;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=Property::class, inversedBy="statementItems")
  74.      * @ORM\JoinColumn(nullable=false)
  75.      **/
  76.     private $property;
  77.     /**
  78.      * @ORM\OneToOne(targetEntity=Maintenance::class, inversedBy="statementItem")
  79.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  80.      **/
  81.     private $maintenance;
  82.     public function __construct(array $defaults = array())
  83.     {
  84.         // Defaults
  85.         $this->setUuid(Uuid::uuid4());
  86.         $this->setCreated(new \DateTime());
  87.         $this->creditAmount 0;
  88.         $this->feeAmount 0;
  89.         $this->costAmount 0;
  90.         $this->VATAmount 0;
  91.         $this->VATRate 0;
  92.         parent::__construct($defaults);
  93.     }
  94.     public function __toString()
  95.     {
  96.         return $this->getId();
  97.     }
  98.     public function getId(): ?int
  99.     {
  100.         return $this->id;
  101.     }
  102.     public function getUuid(): LazyUuidFromString
  103.     {
  104.         return $this->uuid;
  105.     }
  106.     public function setUuid(LazyUuidFromString $uuid): void
  107.     {
  108.         $this->uuid $uuid;
  109.     }
  110.     public function setCreated(\DateTime $created): void
  111.     {
  112.         $this->created $created;
  113.     }
  114.     public function getCreated(): \DateTime
  115.     {
  116.         return $this->created;
  117.     }
  118.     public function getType()
  119.     {
  120.         return $this->type;
  121.     }
  122.     public function setType(int $type)
  123.     {
  124.         $this->type $type;
  125.     }
  126.     public function getStatement()
  127.     {
  128.         return $this->statement;
  129.     }
  130.     public function setStatement(Statement $statement)
  131.     {
  132.         $this->statement $statement;
  133.     }
  134.     public function getProperty()
  135.     {
  136.         return $this->property;
  137.     }
  138.     public function setProperty(Property $property)
  139.     {
  140.         $this->property $property;
  141.     }
  142.     public function getMaintenance()
  143.     {
  144.         return $this->maintenance;
  145.     }
  146.     public function setMaintenance(Maintenance $maintenance)
  147.     {
  148.         $this->maintenance $maintenance;
  149.     }
  150.     public function getCreditAmount()
  151.     {
  152.         return $this->creditAmount;
  153.     }
  154.     public function setCreditAmount(int $creditAmount)
  155.     {
  156.         $this->creditAmount $creditAmount;
  157.     }
  158.     public function getFeeAmount()
  159.     {
  160.         return $this->feeAmount;
  161.     }
  162.     public function setFeeAmount(int $feeAmount)
  163.     {
  164.         $this->feeAmount $feeAmount;
  165.     }
  166.     public function getCostAmount()
  167.     {
  168.         return $this->costAmount;
  169.     }
  170.     public function setCostAmount(int $costAmount)
  171.     {
  172.         $this->costAmount $costAmount;
  173.     }
  174.     public function getDescription()
  175.     {
  176.         return $this->description;
  177.     }
  178.     public function setDescription(string $description)
  179.     {
  180.         $this->description $description;
  181.     }
  182.     public function getVATAmount()
  183.     {
  184.         return $this->VATAmount;
  185.     }
  186.     public function setVATAmount(int $VATAmount)
  187.     {
  188.         $this->VATAmount $VATAmount;
  189.     }
  190.     public function getVATRate()
  191.     {
  192.         return $this->VATRate;
  193.     }
  194.     public function setVATRate(int $VATRate)
  195.     {
  196.         $this->VATRate $VATRate;
  197.     }
  198. }