src/Entity/Equipment.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EquipmentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=EquipmentRepository::class)
  10.  * 
  11.  * @ORM\Table(name="equipment",indexes={
  12.  *     @ORM\Index(name="equipment_technology", columns={"technology"}),
  13.  *     @ORM\Index(name="equipment_name", columns={"name"})
  14.  * })
  15.  */
  16. class Equipment
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="equipment")
  26.      */
  27.     private $user;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      * @Assert\NotBlank
  31.      */
  32.     private $name;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      * @Assert\NotBlank
  36.      */
  37.     private $technology;
  38.     /**
  39.      * @ORM\Column(type="string", length=255)
  40.      * @Assert\NotBlank
  41.      */
  42.     private $brand_model;
  43.     /**
  44.      * @ORM\Column(type="string", length=1000, nullable=true)
  45.      */
  46.     private $images;
  47.     /**
  48.      * @ORM\Column(type="string", length=1000, nullable=true)
  49.      */
  50.     private $files;
  51.     /**
  52.      * @ORM\Column(type="integer")
  53.      */
  54.     private $print_x;
  55.     /**
  56.      * @ORM\Column(type="integer")
  57.      */
  58.     private $print_y;
  59.     /**
  60.      * @ORM\Column(type="integer")
  61.      */
  62.     private $print_z;
  63.     /**
  64.      * @ORM\Column(type="string", length=510, nullable=true)
  65.      * @Assert\Length(
  66.      *      max = 510
  67.      * )
  68.      */
  69.     private $parameters;
  70.     /**
  71.      * @ORM\Column(type="string", length=510, nullable=true)
  72.      * @Assert\Length(
  73.      *      max = 510
  74.      * )
  75.      */
  76.     private $indications;
  77.     /**
  78.      * @ORM\Column(type="string", length=255, nullable=true)
  79.      */
  80.     private $equipment_id;
  81.     /**
  82.      * @ORM\Column(type="string", length=510, nullable=true)
  83.      * @Assert\Length(
  84.      *      max = 510
  85.      * )
  86.      */
  87.     private $description;
  88.     /**
  89.      * @ORM\Column(type="string", length=510, nullable=true)
  90.      * @Assert\Length(
  91.      *      max = 510
  92.      * )
  93.      */
  94.     private $documentation_available;
  95.     /**
  96.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="equipment")
  97.      * @ORM\JoinColumn(onDelete="CASCADE")
  98.      * @ORM\JoinColumn(nullable=false)
  99.      */
  100.     private $company;
  101.     /**
  102.      * @ORM\ManyToMany(targetEntity=Material::class, inversedBy="equipment")
  103.      */
  104.     private $materials;
  105.     public function __construct()
  106.     {
  107.         $this->materials = new ArrayCollection();
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getUser(): ?User
  114.     {
  115.         return $this->user;
  116.     }
  117.     public function setUser(?User $user): self
  118.     {
  119.         $this->user $user;
  120.         return $this;
  121.     }
  122.     public function getName(): ?string
  123.     {
  124.         return $this->name;
  125.     }
  126.     public function setName(string $name): self
  127.     {
  128.         $this->name $name;
  129.         return $this;
  130.     }
  131.     public function getTechnology(): ?string
  132.     {
  133.         return $this->technology;
  134.     }
  135.     public function setTechnology(string $technology): self
  136.     {
  137.         $this->technology $technology;
  138.         return $this;
  139.     }
  140.     public function getBrandModel(): ?string
  141.     {
  142.         return $this->brand_model;
  143.     }
  144.     public function setBrandModel(string $brand_model): self
  145.     {
  146.         $this->brand_model $brand_model;
  147.         return $this;
  148.     }
  149.     public function getImages(): ?string
  150.     {
  151.         return $this->images;
  152.     }
  153.     public function setImages(?string $images): self
  154.     {
  155.         $this->images $images;
  156.         return $this;
  157.     }
  158.     public function getFiles(): ?string
  159.     {
  160.         return $this->files;
  161.     }
  162.     public function setFiles(?string $files): self
  163.     {
  164.         $this->files $files;
  165.         return $this;
  166.     }
  167.     public function getPrintX(): ?int
  168.     {
  169.         return $this->print_x;
  170.     }
  171.     public function setPrintX(int $print_x): self
  172.     {
  173.         $this->print_x $print_x;
  174.         return $this;
  175.     }
  176.     public function getPrintY(): ?int
  177.     {
  178.         return $this->print_y;
  179.     }
  180.     public function setPrintY(int $print_y): self
  181.     {
  182.         $this->print_y $print_y;
  183.         return $this;
  184.     }
  185.     public function getPrintZ(): ?int
  186.     {
  187.         return $this->print_z;
  188.     }
  189.     public function setPrintZ(int $print_z): self
  190.     {
  191.         $this->print_z $print_z;
  192.         return $this;
  193.     }
  194.     public function getParameters(): ?string
  195.     {
  196.         return $this->parameters;
  197.     }
  198.     public function setParameters(string $parameters): self
  199.     {
  200.         $this->parameters $parameters;
  201.         return $this;
  202.     }
  203.     public function getIndications(): ?string
  204.     {
  205.         return $this->indications;
  206.     }
  207.     public function setIndications(?string $indications): self
  208.     {
  209.         $this->indications $indications;
  210.         return $this;
  211.     }
  212.     public function getEquipmentId(): ?string
  213.     {
  214.         return $this->equipment_id;
  215.     }
  216.     public function setEquipmentId(?string $equipment_id): self
  217.     {
  218.         $this->equipment_id $equipment_id;
  219.         return $this;
  220.     }
  221.     public function getDescription(): ?string
  222.     {
  223.         return $this->description;
  224.     }
  225.     public function setDescription(?string $description): self
  226.     {
  227.         $this->description $description;
  228.         return $this;
  229.     }
  230.     public function getDocumentationAvailable(): ?string
  231.     {
  232.         return $this->documentation_available;
  233.     }
  234.     public function setDocumentationAvailable(?string $documentation_available): self
  235.     {
  236.         $this->documentation_available $documentation_available;
  237.         return $this;
  238.     }
  239.     public function getCompany(): ?Company
  240.     {
  241.         return $this->company;
  242.     }
  243.     public function setCompany(?Company $company): self
  244.     {
  245.         $this->company $company;
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return Collection<int, Material>
  250.      */
  251.     public function getMaterials(): Collection
  252.     {
  253.         return $this->materials;
  254.     }
  255.     public function addMaterial(Material $material): self
  256.     {
  257.         if (!$this->materials->contains($material)) {
  258.             $this->materials[] = $material;
  259.         }
  260.         return $this;
  261.     }
  262.     public function removeMaterial(Material $material): self
  263.     {
  264.         $this->materials->removeElement($material);
  265.         return $this;
  266.     }
  267. }