src/Entity/Empresa.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use App\Entity\Usuario;
  7. // src/Entity/Empresa.php
  8. #[ORM\Entity]
  9. class Empresa
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private string $name;
  17.     #[ORM\Column(type'integer')]
  18.     private int $maxDiskQuota;
  19.     #[ORM\Column(type'integer'options: ['default' => 4])]
  20.     private int $maxThreads 4;
  21.     
  22.     #[ORM\OneToOne(mappedBy'empresa'targetEntityConexionBD::class, cascade: ['persist''remove'])]
  23.     private ?ConexionBD $conexionBD null;
  24.     
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getName(): string
  30.     {
  31.         return $this->name;
  32.     }
  33.     public function setName(string $name): self
  34.     {
  35.         $this->name $name;
  36.         return $this;
  37.     }
  38.     public function getMaxDiskQuota(): int
  39.     {
  40.         return $this->maxDiskQuota;
  41.     }
  42.     public function setMaxDiskQuota(int $maxDiskQuota): self
  43.     {
  44.         $this->maxDiskQuota $maxDiskQuota;
  45.         return $this;
  46.     }
  47.     public function getMaxThreads(): int
  48.     {
  49.         return $this->maxThreads;
  50.     }
  51.     public function setMaxThreads(int $maxThreads): self
  52.     {
  53.         if ($maxThreads 1) {
  54.             $maxThreads 1;
  55.         } elseif ($maxThreads 16) {
  56.             $maxThreads 16;
  57.         }
  58.         $this->maxThreads $maxThreads;
  59.         return $this;
  60.     }
  61.     
  62.     
  63.     public function getConexionBD(): ?ConexionBD
  64.     {
  65.         return $this->conexionBD;
  66.     }
  67.     public function setConexionBD(?ConexionBD $conexionBD): self
  68.     {
  69.         $this->conexionBD $conexionBD;
  70.         // set the owning side of the relation if necessary
  71.         if ($conexionBD !== null ) {
  72.             $conexionBD->setEmpresa($this);
  73.         }
  74.         return $this;
  75.     }
  76. }