src/Entity/Otpusk/CitiesWeight.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Otpusk;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\Otpusk\CitiesWeightRepository")
  6.  *
  7.  * @ORM\Table(
  8.  *     name="citiesWeight",
  9.  *     uniqueConstraints={@ORM\UniqueConstraint(name="indexUnique", columns={"cityId", "month"})}, indexes={@ORM\Index(name="index2", columns={"cityId", "month"})},
  10.  *     options={"collate"="utf8"},
  11.  * )
  12.  */
  13. class CitiesWeight
  14. {
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="smallint", options={"unsigned"=true})
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Otpusk\City", inversedBy="citiesWeights", cascade={"persist"})
  23.      * @ORM\JoinColumn(name="cityId", referencedColumnName="rec_id", nullable=false, columnDefinition="INT UNSIGNED NOT NULL")
  24.      */
  25.     private $city;
  26.     /**
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     private $month;
  30.     /**
  31.      * @ORM\Column(type="decimal", precision=4, scale=2)
  32.      */
  33.     private $weight;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getCity(): ?City
  39.     {
  40.         return $this->city;
  41.     }
  42.     public function setCity(?City $city): self
  43.     {
  44.         $this->city $city;
  45.         return $this;
  46.     }
  47.     public function getMonth(): ?int
  48.     {
  49.         return $this->month;
  50.     }
  51.     public function setMonth(int $month): self
  52.     {
  53.         $this->month $month;
  54.         return $this;
  55.     }
  56.     public function getWeight(): ?string
  57.     {
  58.         return $this->weight;
  59.     }
  60.     public function setWeight(string $weight): self
  61.     {
  62.         $this->weight $weight;
  63.         return $this;
  64.     }
  65. }