src/Entity/MetricUnit.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MetricUnitRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * MetricUnit
  7.  *
  8.  * @ORM\Table(name="metric_unit", uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"}), @ORM\UniqueConstraint(name="abbreviation", columns={"abbreviation"})})
  9.  * @ORM\Entity()
  10.  */
  11. class MetricUnit
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="string", length=5)
  25.      */
  26.     private $abbreviation;
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getName(): ?string
  32.     {
  33.         return $this->name;
  34.     }
  35.     public function setName(string $name): self
  36.     {
  37.         $this->name $name;
  38.         return $this;
  39.     }
  40.     public function getAbbreviation(): ?string
  41.     {
  42.         return $this->abbreviation;
  43.     }
  44.     public function setAbbreviation(string $abbreviation): self
  45.     {
  46.         $this->abbreviation $abbreviation;
  47.         return $this;
  48.     }
  49.     public function __toString()
  50.     {
  51.         return $this->abbreviation;
  52.     }
  53. }