src/Entity/Lineas.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. // use App\Repository\LineasRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. /**
  11.  * @Gedmo\Tree(type="nested")
  12.  * use repository for handy tree functions
  13.  * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
  14.  */
  15. class Lineas
  16. {
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="datetime", nullable=true)
  25.      */
  26.     private $createAt;
  27.     /**
  28.      * @ORM\Column(type="integer", nullable=true)
  29.      */
  30.     private $codarticulo;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      * @Assert\Length(max=35)
  34.      */
  35.     private $descripcion;
  36.     /**
  37.      * @ORM\Column(type="integer", nullable=true)
  38.      */
  39.     private $codfavorito;
  40.     /**
  41.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  42.      */
  43.     private $precio;
  44.     /**
  45.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  46.      */
  47.     private $preciosiniva;
  48.     /**
  49.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  50.      */
  51.     private $precioiva;
  52.     /**
  53.      * @ORM\Column(type="integer", nullable=true)
  54.      */
  55.     private $codimpuesto;
  56.     /**
  57.      * @ORM\Column(type="integer", nullable=true)
  58.      */
  59.     private $codmodificador;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity=cabecera::class, inversedBy="lineas")
  62.      */
  63.     private $cabecera;
  64.     /**
  65.      * @ORM\Column(type="integer", nullable=true)
  66.      */
  67.     private $numlineasmodif;
  68.     /**
  69.      * @ORM\Column(type="integer", nullable=true)
  70.      */
  71.     private $codfavoritos;
  72.     /**
  73.      * @Gedmo\TreeLeft
  74.      * @ORM\Column(name="lft", type="integer")
  75.      */
  76.     private $lft;
  77.     /**
  78.      * @Gedmo\TreeLevel
  79.      * @ORM\Column(name="lvl", type="integer")
  80.      */
  81.     private $lvl;
  82.     /**
  83.      * @Gedmo\TreeRight
  84.      * @ORM\Column(name="rgt", type="integer")
  85.      */
  86.     private $rgt;
  87.     /**
  88.      * @Gedmo\TreeRoot
  89.      * @ORM\ManyToOne(targetEntity="Lineas")
  90.      * @ORM\JoinColumn(name="tree_root", referencedColumnName="id", onDelete="CASCADE")
  91.      */
  92.     private $root;
  93.     /**
  94.      * @Gedmo\TreeParent
  95.      * @ORM\ManyToOne(targetEntity="Lineas", inversedBy="children")
  96.      * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
  97.      */
  98.     private $parent;
  99.     /**
  100.      * @ORM\OneToMany(targetEntity="Lineas", mappedBy="parent")
  101.      * @ORM\OrderBy({"lft" = "ASC"})
  102.      */
  103.     private $children;
  104.     /**
  105.      * @ORM\Column(type="integer")
  106.      */
  107.     private $unidades 1;
  108.     /**
  109.      * @ORM\Column(type="integer", nullable=true)
  110.      */
  111.     private $preciototal;
  112.     /**
  113.      * @ORM\Column(type="integer", nullable=true)
  114.      */
  115.     private $posicion;
  116.     /**
  117.      * @ORM\Column(type="integer", nullable=true)
  118.      */
  119.     private $preciounidad;
  120.     public function __construct()
  121.     {
  122.         $this->children = new ArrayCollection();
  123.     }
  124.     public function __toString()
  125.     {
  126.         return $this->getDescripcion();
  127.     }
  128.     public function getId(): ?int
  129.     {
  130.         return $this->id;
  131.     }
  132.     public function getCreateAt(): ?\DateTimeInterface
  133.     {
  134.         return $this->createAt;
  135.     }
  136.     public function setCreateAt(?\DateTimeInterface $createAt): self
  137.     {
  138.         $this->createAt $createAt;
  139.         return $this;
  140.     }
  141.     public function getCodarticulo(): ?int
  142.     {
  143.         return $this->codarticulo;
  144.     }
  145.     public function setCodarticulo(?int $codarticulo): self
  146.     {
  147.         $this->codarticulo $codarticulo;
  148.         return $this;
  149.     }
  150.     public function getDescripcion(): ?string
  151.     {
  152.         return $this->descripcion;
  153.     }
  154.     public function setDescripcion(?string $descripcion): self
  155.     {
  156.         $this->descripcion $descripcion;
  157.         return $this;
  158.     }
  159.     public function getCodfavorito(): ?int
  160.     {
  161.         return $this->codfavorito;
  162.     }
  163.     public function setCodfavorito(?int $codfavorito): self
  164.     {
  165.         $this->codfavorito $codfavorito;
  166.         return $this;
  167.     }
  168.     public function getPrecio(): ?string
  169.     {
  170.         return $this->precio;
  171.     }
  172.     public function setPrecio(?string $precio): self
  173.     {
  174.         $this->precio $precio;
  175.         return $this;
  176.     }
  177.     public function getPreciosiniva(): ?string
  178.     {
  179.         return $this->preciosiniva;
  180.     }
  181.     public function setPreciosiniva(?string $preciosiniva): self
  182.     {
  183.         $this->preciosiniva $preciosiniva;
  184.         return $this;
  185.     }
  186.     public function getPrecioiva(): ?string
  187.     {
  188.         return $this->precioiva;
  189.     }
  190.     public function setPrecioiva(?string $precioiva): self
  191.     {
  192.         $this->precioiva $precioiva;
  193.         return $this;
  194.     }
  195.     public function getCodimpuesto(): ?int
  196.     {
  197.         return $this->codimpuesto;
  198.     }
  199.     public function setCodimpuesto(?int $codimpuesto): self
  200.     {
  201.         $this->codimpuesto $codimpuesto;
  202.         return $this;
  203.     }
  204.     public function getCodmodificador(): ?int
  205.     {
  206.         return $this->codmodificador;
  207.     }
  208.     public function setCodmodificador(?int $codmodificador): self
  209.     {
  210.         $this->codmodificador $codmodificador;
  211.         return $this;
  212.     }
  213.     public function getNumlineasmodif(): ?int
  214.     {
  215.         return $this->numlineasmodif;
  216.     }
  217.     public function setNumlineasmodif(?int $numlineasmodif): self
  218.     {
  219.         $this->numlineasmodif $numlineasmodif;
  220.         return $this;
  221.     }
  222.     public function getCodfavoritos(): ?int
  223.     {
  224.         return $this->codfavoritos;
  225.     }
  226.     public function setCodfavoritos(?int $codfavoritos): self
  227.     {
  228.         $this->codfavoritos $codfavoritos;
  229.         return $this;
  230.     }
  231.     public function getLft(): ?int
  232.     {
  233.         return $this->lft;
  234.     }
  235.     public function setLft(int $lft): self
  236.     {
  237.         $this->lft $lft;
  238.         return $this;
  239.     }
  240.     public function getLvl(): ?int
  241.     {
  242.         return $this->lvl;
  243.     }
  244.     public function setLvl(int $lvl): self
  245.     {
  246.         $this->lvl $lvl;
  247.         return $this;
  248.     }
  249.     public function getRgt(): ?int
  250.     {
  251.         return $this->rgt;
  252.     }
  253.     public function setRgt(int $rgt): self
  254.     {
  255.         $this->rgt $rgt;
  256.         return $this;
  257.     }
  258.     public function getCabecera(): ?cabecera
  259.     {
  260.         return $this->cabecera;
  261.     }
  262.     public function setCabecera(?cabecera $cabecera): self
  263.     {
  264.         $this->cabecera $cabecera;
  265.         return $this;
  266.     }
  267.     public function getRoot(): ?self
  268.     {
  269.         return $this->root;
  270.     }
  271.     public function setRoot(?self $root): self
  272.     {
  273.         $this->root $root;
  274.         return $this;
  275.     }
  276.     public function getParent(): ?self
  277.     {
  278.         return $this->parent;
  279.     }
  280.     public function setParent(?self $parent): self
  281.     {
  282.         $this->parent $parent;
  283.         return $this;
  284.     }
  285.     /**
  286.      * @return Collection|Lineas[]
  287.      */
  288.     public function getChildren(): Collection
  289.     {
  290.         return $this->children;
  291.     }
  292.     public function addChild(Lineas $child): self
  293.     {
  294.         if (!$this->children->contains($child)) {
  295.             $this->children[] = $child;
  296.             $child->setParent($this);
  297.         }
  298.         return $this;
  299.     }
  300.     public function removeChild(Lineas $child): self
  301.     {
  302.         if ($this->children->removeElement($child)) {
  303.             // set the owning side to null (unless already changed)
  304.             if ($child->getParent() === $this) {
  305.                 $child->setParent(null);
  306.             }
  307.         }
  308.         return $this;
  309.     }
  310.     public function getUnidades(): ?int
  311.     {
  312.         return $this->unidades;
  313.     }
  314.     public function setUnidades(int $unidades): self
  315.     {
  316.         $this->unidades $unidades;
  317.         return $this;
  318.     }
  319.     public function getPreciototal(): ?int
  320.     {
  321.         return $this->preciototal;
  322.     }
  323.     public function setPreciototal(?int $preciototal): self
  324.     {
  325.         $this->preciototal $preciototal;
  326.         return $this;
  327.     }
  328.     public function getPosicion(): ?int
  329.     {
  330.         return $this->posicion;
  331.     }
  332.     public function setPosicion(?int $posicion): self
  333.     {
  334.         $this->posicion $posicion;
  335.         return $this;
  336.     }
  337.     public function getPreciounidad(): ?int
  338.     {
  339.         return $this->preciounidad;
  340.     }
  341.     public function setPreciounidad(?int $preciounidad): self
  342.     {
  343.         $this->preciounidad $preciounidad;
  344.         return $this;
  345.     }
  346. }