src/Entity/Storage.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table(name="storages__storages")
  6.  * @ORM\Entity(repositoryClass="App\Repository\StorageRepository")
  7.  */
  8. class Storage
  9. {
  10.     use IdTrait;
  11.     /**
  12.      * @ORM\OneToOne(targetEntity="Product")
  13.      * @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  14.      */
  15.     private Product $product;
  16.     /**
  17.      * @ORM\Column(name="place", type="string")
  18.      */
  19.     private string $place;
  20.     public function __construct(Product $productstring $place)
  21.     {
  22.         $this->product $product;
  23.         $this->place $place;
  24.     }
  25.     public function getProduct(): Product
  26.     {
  27.         return $this->product;
  28.     }
  29.     public function getPlace(): string
  30.     {
  31.         return $this->place;
  32.     }
  33.     public function setPlace(string $place): Storage
  34.     {
  35.         $this->place $place;
  36.         return $this;
  37.     }
  38. }