|
@@ -2,18 +2,20 @@
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
+use App\Config\View;
|
|
|
use App\Repository\ProfileRepository;
|
|
|
+use Doctrine\DBAL\Types\Types;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
#[ORM\Entity(repositoryClass: ProfileRepository::class)]
|
|
|
class Profile
|
|
|
{
|
|
|
- public static $VIEW = ['liste' => 0, 'vignette' => 1];
|
|
|
+ //public static $VIEW = ['liste' => 0, 'vignette' => 1];
|
|
|
|
|
|
|
|
|
#[ORM\Id]
|
|
|
#[ORM\GeneratedValue]
|
|
|
- #[ORM\Column(type: "integer")]
|
|
|
+ #[ORM\Column(type: Types::INTEGER)]
|
|
|
|
|
|
private ?int $id = null;
|
|
|
|
|
@@ -24,13 +26,13 @@ class Profile
|
|
|
private ?User $user = null;
|
|
|
|
|
|
|
|
|
- #[ORM\Column(type: "integer")]
|
|
|
+ #[ORM\Column(type: Types::INTEGER, enumType: View::class)]
|
|
|
|
|
|
- private ?int $view = null;
|
|
|
+ private ?View $view = null;
|
|
|
|
|
|
public function __construct()
|
|
|
{
|
|
|
- $this->setView(Profile::$VIEW['vignette']);
|
|
|
+ $this->setView(View::VIGNETTE);
|
|
|
}
|
|
|
|
|
|
public function getId(): ?int
|
|
@@ -50,12 +52,12 @@ class Profile
|
|
|
return $this;
|
|
|
}
|
|
|
|
|
|
- public function getView(): ?int
|
|
|
+ public function getView(): ?View
|
|
|
{
|
|
|
return $this->view;
|
|
|
}
|
|
|
|
|
|
- public function setView(?int $view): self
|
|
|
+ public function setView(?View $view): self
|
|
|
{
|
|
|
$this->view = $view;
|
|
|
|