<?php
namespace App\Entity;
use App\Repository\EquipmentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=EquipmentRepository::class)
*
* @ORM\Table(name="equipment",indexes={
* @ORM\Index(name="equipment_technology", columns={"technology"}),
* @ORM\Index(name="equipment_name", columns={"name"})
* })
*/
class Equipment
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="equipment")
*/
private $user;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
*/
private $technology;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
*/
private $brand_model;
/**
* @ORM\Column(type="string", length=1000, nullable=true)
*/
private $images;
/**
* @ORM\Column(type="string", length=1000, nullable=true)
*/
private $files;
/**
* @ORM\Column(type="integer")
*/
private $print_x;
/**
* @ORM\Column(type="integer")
*/
private $print_y;
/**
* @ORM\Column(type="integer")
*/
private $print_z;
/**
* @ORM\Column(type="string", length=510, nullable=true)
* @Assert\Length(
* max = 510
* )
*/
private $parameters;
/**
* @ORM\Column(type="string", length=510, nullable=true)
* @Assert\Length(
* max = 510
* )
*/
private $indications;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $equipment_id;
/**
* @ORM\Column(type="string", length=510, nullable=true)
* @Assert\Length(
* max = 510
* )
*/
private $description;
/**
* @ORM\Column(type="string", length=510, nullable=true)
* @Assert\Length(
* max = 510
* )
*/
private $documentation_available;
/**
* @ORM\ManyToOne(targetEntity=Company::class, inversedBy="equipment")
* @ORM\JoinColumn(onDelete="CASCADE")
* @ORM\JoinColumn(nullable=false)
*/
private $company;
/**
* @ORM\ManyToMany(targetEntity=Material::class, inversedBy="equipment")
*/
private $materials;
public function __construct()
{
$this->materials = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getTechnology(): ?string
{
return $this->technology;
}
public function setTechnology(string $technology): self
{
$this->technology = $technology;
return $this;
}
public function getBrandModel(): ?string
{
return $this->brand_model;
}
public function setBrandModel(string $brand_model): self
{
$this->brand_model = $brand_model;
return $this;
}
public function getImages(): ?string
{
return $this->images;
}
public function setImages(?string $images): self
{
$this->images = $images;
return $this;
}
public function getFiles(): ?string
{
return $this->files;
}
public function setFiles(?string $files): self
{
$this->files = $files;
return $this;
}
public function getPrintX(): ?int
{
return $this->print_x;
}
public function setPrintX(int $print_x): self
{
$this->print_x = $print_x;
return $this;
}
public function getPrintY(): ?int
{
return $this->print_y;
}
public function setPrintY(int $print_y): self
{
$this->print_y = $print_y;
return $this;
}
public function getPrintZ(): ?int
{
return $this->print_z;
}
public function setPrintZ(int $print_z): self
{
$this->print_z = $print_z;
return $this;
}
public function getParameters(): ?string
{
return $this->parameters;
}
public function setParameters(string $parameters): self
{
$this->parameters = $parameters;
return $this;
}
public function getIndications(): ?string
{
return $this->indications;
}
public function setIndications(?string $indications): self
{
$this->indications = $indications;
return $this;
}
public function getEquipmentId(): ?string
{
return $this->equipment_id;
}
public function setEquipmentId(?string $equipment_id): self
{
$this->equipment_id = $equipment_id;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDocumentationAvailable(): ?string
{
return $this->documentation_available;
}
public function setDocumentationAvailable(?string $documentation_available): self
{
$this->documentation_available = $documentation_available;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
/**
* @return Collection<int, Material>
*/
public function getMaterials(): Collection
{
return $this->materials;
}
public function addMaterial(Material $material): self
{
if (!$this->materials->contains($material)) {
$this->materials[] = $material;
}
return $this;
}
public function removeMaterial(Material $material): self
{
$this->materials->removeElement($material);
return $this;
}
}