12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Entity;
- use App\Repository\ProfileRepository;
- use Doctrine\ORM\Mapping as ORM;
- #[ORM\Entity(repositoryClass: ProfileRepository::class)]
- class Profile
- {
- public static $VIEW = ['liste' => 0, 'vignette' => 1];
- #[ORM\Id]
- #[ORM\GeneratedValue]
- #[ORM\Column(type: "integer")]
- private $id;
- #[ORM\OneToOne(targetEntity: User::class, inversedBy: "profile", cascade: ["persist", "remove"])]
- #[ORM\JoinColumn(nullable: false)]
- private $user;
- #[ORM\Column(type: "integer")]
- private $view;
- public function __construct()
- {
- $this->setView(Profile::$VIEW['vignette']);
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getUser(): ?User
- {
- return $this->user;
- }
- public function setUser(User $user): self
- {
- $this->user = $user;
- return $this;
- }
- public function getView(): ?int
- {
- return $this->view;
- }
- public function setView(int $view): self
- {
- $this->view = $view;
- return $this;
- }
- }
|