<?php
namespace App\Entity;
use App\Repository\CompteRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CompteRepository::class)
*/
class Compte
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $prenom;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\OneToOne(targetEntity=User::class, mappedBy="compte")
*/
private $user;
public function getId(): ?int
{
return $this->id;
}
public function getPrenom(): ?string
{
return $this->prenom;
}
public function setPrenom(?string $prenom): self
{
$this->prenom = $prenom;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(User $user): self
{
// set the owning side of the relation if necessary
if ($user->getCompte() !== $this) {
$user->setCompte($this);
}
$this->user = $user;
return $this;
}
}