1 | <?php |
||
27 | class GoogleIdentity implements EntityInterface |
||
28 | { |
||
29 | use Traits\PropertyIdGeneratedTrait; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | * @ORM\Column(name="google_id", type="string", length=25, nullable=false, unique=true) |
||
34 | * |
||
35 | * @Assert\NotBlank() |
||
36 | * @Assert\Length(min="1", max="25") |
||
37 | */ |
||
38 | private $googleId; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | * @ORM\Column(name="email", type="string", length=255, nullable=false, unique=true) |
||
43 | * |
||
44 | * @Assert\NotBlank() |
||
45 | * @Assert\Email() |
||
46 | * @Assert\Length(min="1", max="255") |
||
47 | */ |
||
48 | private $email; |
||
49 | |||
50 | /** |
||
51 | * @var string |
||
52 | * @ORM\Column(name="name", type="string", length=255, nullable=false) |
||
53 | * |
||
54 | * @Assert\NotBlank() |
||
55 | * @Assert\Length(min="1", max="255") |
||
56 | */ |
||
57 | private $name; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | * @ORM\Column(name="given_name", type="string", length=255, nullable=false) |
||
62 | * |
||
63 | * @Assert\NotBlank() |
||
64 | * @Assert\Length(min="1", max="255") |
||
65 | */ |
||
66 | private $givenName; |
||
67 | |||
68 | /** |
||
69 | * @var string |
||
70 | * @ORM\Column(name="family_name", type="string", length=255, nullable=false) |
||
71 | * |
||
72 | * @Assert\NotBlank() |
||
73 | * @Assert\Length(min="1", max="255") |
||
74 | */ |
||
75 | private $familyName; |
||
76 | |||
77 | /** |
||
78 | * @var string |
||
79 | * @ORM\Column(name="picture", type="string", length=255, nullable=false) |
||
80 | * |
||
81 | * @Assert\NotBlank() |
||
82 | * @Assert\Length(min="1", max="255") |
||
83 | */ |
||
84 | private $picture; |
||
85 | |||
86 | /** |
||
87 | * @var string |
||
88 | * @ORM\Column(name="locale", type="string", length=5, nullable=false) |
||
89 | * |
||
90 | * @Assert\NotBlank() |
||
91 | * @Assert\Locale() |
||
92 | * @Assert\Length(min="2", max="5") |
||
93 | */ |
||
94 | private $locale; |
||
95 | |||
96 | //------------------------------------------------------------------------------------------- |
||
97 | |||
98 | /** |
||
99 | * @var User |
||
100 | * @ORM\OneToOne(targetEntity="App\Entity\Access\User", inversedBy="googleIdentity", cascade={"persist"}) |
||
101 | * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false, unique=true) |
||
102 | * @Assert\NotBlank() |
||
103 | */ |
||
104 | private $user; |
||
105 | |||
106 | //------------------------------------------------------------------------------------------- |
||
107 | |||
108 | public function __construct(User $user, string $googleId, string $email) |
||
115 | |||
116 | //------------------------------------------------------------------------------------------- |
||
117 | |||
118 | public function getUser(): User |
||
122 | |||
123 | public function getGoogleId(): string |
||
127 | |||
128 | public function getEmail(): string |
||
132 | |||
133 | public function getName(): ?string |
||
137 | |||
138 | public function setName(string $name): self |
||
144 | |||
145 | public function getGivenName(): ?string |
||
149 | |||
150 | public function setGivenName(string $givenName): self |
||
156 | |||
157 | public function getFamilyName(): ?string |
||
161 | |||
162 | public function setFamilyName(string $familyName): self |
||
168 | |||
169 | public function getPicture(): ?string |
||
173 | |||
174 | public function setPicture(string $picture): self |
||
180 | |||
181 | public function getLocale(): ?string |
||
185 | |||
186 | public function setLocale(string $locale): self |
||
192 | } |
||
193 |