src/MDS/VenuesBundle/Entity/ReservationInvoiceDepositItems.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\MDS\VenuesBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * ReservationInvoiceDepositItems
  7.  *
  8.  * @ORM\Table(name="reservation_invoice_deposit_items")
  9.  * @ORM\Entity(repositoryClass="App\MDS\VenuesBundle\Repository\ReservationInvoiceDepositItemsRepository")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class ReservationInvoiceDepositItems
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var int
  24.      *
  25.      * @ORM\Column(name="controlId", type="integer", nullable=true)
  26.      */
  27.     private $controlId;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="name", type="string", length=255)
  32.      * @Assert\NotBlank()
  33.      */
  34.     private $name;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="amount", type="string", length=255)
  39.      * @Assert\NotBlank()
  40.      */
  41.     private $amount;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="iva", type="string", length=255)
  46.      * @Assert\NotBlank()
  47.      */
  48.     private $iva;
  49.     /**
  50.      * @var int
  51.      *
  52.      * @ORM\Column(name="reservation_id", type="integer")
  53.      */
  54.     private $reservationId;
  55.     /**
  56.      * @var \DateTime
  57.      *
  58.      * @ORM\Column(name="created_at", type="datetime")
  59.      */
  60.     private $createdAt;
  61.     /**
  62.      * @var int
  63.      *
  64.      * @ORM\Column(name="created_id", type="integer")
  65.      */
  66.     private $createdId;
  67.     /**
  68.      * @var \DateTime
  69.      *
  70.      * @ORM\Column(name="updated_at", type="datetime")
  71.      */
  72.     private $updatedAt;
  73.     /**
  74.      * @var int
  75.      *
  76.      * @ORM\Column(name="updated_id", type="integer")
  77.      */
  78.     private $updatedId;
  79.     /**
  80.      * @ORM\OneToOne(targetEntity="App\MDS\VenuesBundle\Entity\ReservationInvoiceItems", inversedBy="depositItem", cascade={"persist"})
  81.      * @ORM\JoinColumn(
  82.      *     name="reservation_invoice_item_id",
  83.      *     referencedColumnName="id",
  84.      *     nullable=true,
  85.      *     onDelete="SET NULL",
  86.      *     unique=true
  87.      * )
  88.      */
  89.     private $invoiceItem;
  90.     /**
  91.      * Get id
  92.      *
  93.      * @return int
  94.      */
  95.     public function getId()
  96.     {
  97.         return $this->id;
  98.     }
  99.     /**
  100.      * Set controlId
  101.      *
  102.      * @param integer $controlId
  103.      *
  104.      * @return ReservationInvoiceDepositItems
  105.      */
  106.     public function setControlId($controlId)
  107.     {
  108.         $this->controlId $controlId;
  109.         return $this;
  110.     }
  111.     /**
  112.      * Get controlId
  113.      *
  114.      * @return int
  115.      */
  116.     public function getControlId()
  117.     {
  118.         return $this->controlId;
  119.     }
  120.     /**
  121.      * Set name
  122.      *
  123.      * @param string $name
  124.      *
  125.      * @return ReservationInvoiceDepositItems
  126.      */
  127.     public function setName($name)
  128.     {
  129.         $this->name $name;
  130.         return $this;
  131.     }
  132.     /**
  133.      * Get name
  134.      *
  135.      * @return string
  136.      */
  137.     public function getName()
  138.     {
  139.         return $this->name;
  140.     }
  141.     /**
  142.      * Set amount
  143.      *
  144.      * @param string $amount
  145.      *
  146.      * @return ReservationInvoiceDepositItems
  147.      */
  148.     public function setAmount($amount)
  149.     {
  150.         $this->amount $amount;
  151.         return $this;
  152.     }
  153.     /**
  154.      * Get amount
  155.      *
  156.      * @return string
  157.      */
  158.     public function getAmount()
  159.     {
  160.         return $this->amount;
  161.     }
  162.     /**
  163.      * Set iva
  164.      *
  165.      * @param string $iva
  166.      *
  167.      * @return ReservationInvoiceDepositItems
  168.      */
  169.     public function setIva($iva)
  170.     {
  171.         $this->iva $iva;
  172.         return $this;
  173.     }
  174.     /**
  175.      * Get iva
  176.      *
  177.      * @return string
  178.      */
  179.     public function getIva()
  180.     {
  181.         return $this->iva;
  182.     }
  183.     /**
  184.      * Set reservationId
  185.      *
  186.      * @param integer $reservationId
  187.      *
  188.      * @return ReservationInvoiceDepositItems
  189.      */
  190.     public function setReservationId($reservationId)
  191.     {
  192.         $this->reservationId $reservationId;
  193.         return $this;
  194.     }
  195.     /**
  196.      * Get reservationId
  197.      *
  198.      * @return integer
  199.      */
  200.     public function getReservationId()
  201.     {
  202.         return $this->reservationId;
  203.     }
  204.     /**
  205.      * Set createdAt
  206.      *
  207.      * @param \DateTime $createdAt
  208.      *
  209.      * @return ReservationInvoiceDepositItems
  210.      */
  211.     public function setCreatedAt($createdAt)
  212.     {
  213.         $this->createdAt $createdAt;
  214.         return $this;
  215.     }
  216.     /**
  217.      * Get createdAt
  218.      *
  219.      * @return \DateTime
  220.      */
  221.     public function getCreatedAt()
  222.     {
  223.         return $this->createdAt;
  224.     }
  225.     /**
  226.      * Set createdId
  227.      *
  228.      * @param integer $createdId
  229.      *
  230.      * @return ReservationInvoiceDepositItems
  231.      */
  232.     public function setCreatedId($createdId)
  233.     {
  234.         $this->createdId $createdId;
  235.         return $this;
  236.     }
  237.     /**
  238.      * Get createdId
  239.      *
  240.      * @return integer
  241.      */
  242.     public function getCreatedId()
  243.     {
  244.         return $this->createdId;
  245.     }
  246.     /**
  247.      * Set updatedAt
  248.      *
  249.      * @param \DateTime $updatedAt
  250.      *
  251.      * @return ReservationInvoiceDepositItems
  252.      */
  253.     public function setUpdatedAt($updatedAt)
  254.     {
  255.         $this->updatedAt $updatedAt;
  256.         return $this;
  257.     }
  258.     /**
  259.      * Get updatedAt
  260.      *
  261.      * @return \DateTime
  262.      */
  263.     public function getUpdatedAt()
  264.     {
  265.         return $this->updatedAt;
  266.     }
  267.     /**
  268.      * Set updatedId
  269.      *
  270.      * @param integer $updatedId
  271.      *
  272.      * @return ReservationInvoiceDepositItems
  273.      */
  274.     public function setUpdatedId($updatedId)
  275.     {
  276.         $this->updatedId $updatedId;
  277.         return $this;
  278.     }
  279.     /**
  280.      * Get updatedId
  281.      *
  282.      * @return integer
  283.      */
  284.     public function getUpdatedId()
  285.     {
  286.         return $this->updatedId;
  287.     }
  288.     public function getInvoiceItem(): ?ReservationInvoiceItems
  289.     {
  290.         return $this->invoiceItem;
  291.     }
  292.     public function setInvoiceItem(?ReservationInvoiceItems $invoiceItem): self
  293.     {
  294.         $this->invoiceItem $invoiceItem;
  295.         // Sincronizar el lado inverso
  296.         if ($invoiceItem !== null && $invoiceItem->getDepositItem() !== $this) {
  297.             $invoiceItem->setDepositItem($this);
  298.         }
  299.         return $this;
  300.     }
  301.     /**
  302.      * @ORM\PrePersist
  303.      */
  304.     public function setCreatedAtValue()
  305.     {
  306.         $this->createdAt = new \Datetime();
  307.     }
  308.     /**
  309.      * @ORM\PrePersist
  310.      * @ORM\PreUpdate
  311.      */
  312.     public function setUpdatedAtValue()
  313.     {
  314.         $this->updatedAt = new \Datetime();
  315.     }
  316. }