src/Entity/UserProfile.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\UserProfileRepository")
  6.  * @ORM\Table(name="users_profiles", indexes={@ORM\Index(name="id_index", columns={"id"})})
  7.  */
  8. class UserProfile
  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="userProfiles")
  18.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  19.      */
  20.     private $user;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Profile", inversedBy="userProfiles")
  23.      * @ORM\JoinColumn(name="profile_id", referencedColumnName="id", nullable=false)
  24.      */
  25.     private $profile;
  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 getProfile(): ?Profile
  40.     {
  41.         return $this->profile;
  42.     }
  43.     public function setProfile(?Profile $profile): self
  44.     {
  45.         $this->profile $profile;
  46.         return $this;
  47.     }
  48. }