src/Entity/UserCustomer.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\UserCustomerRepository")
  6.  * @ORM\Table(name="users_customers", indexes={@ORM\Index(name="id_index", columns={"id"})})
  7.  */
  8. class UserCustomer
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\Column(type="integer")
  13.      * @ORM\GeneratedValue(strategy="AUTO")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="userCustomers")
  18.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  19.      */
  20.     private $user;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="userCustomers")
  23.      * @ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)
  24.      */
  25.     private $customer;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getUser(): ?User
  31.     {
  32.         return $this->user;
  33.     }
  34.     public function setUser(?User $user): self
  35.     {
  36.         $this->user $user;
  37.         return $this;
  38.     }
  39.     public function getCustomer(): ?Customer
  40.     {
  41.         return $this->customer;
  42.     }
  43.     public function setCustomer(?Customer $customer): self
  44.     {
  45.         $this->customer $customer;
  46.         return $this;
  47.     }
  48. }