Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. The "App\Entity\User" entity has a repositoryClass set to "App\Repository\UserRepository",
  2.  
  3. but this is not a valid class. Check your class naming. If this is meant to be a service id,
  4.  
  5. make sure this service exists and is tagged with "doctrine.repository_service".
  6.  
  7. at /home/barbet/www/GrandProjet/vendor/symfony/security/Core/Authentication/Provider/DaoAuthenticationProvider.php:85,
  8.  
  9. RuntimeException(code: 0): The "App\Entity\User" entity has a repositoryClass set to "App\Repository\UserRepository",
  10.  
  11. but this is not a valid class. Check your class naming. If this is meant to be a service id, make sure this service exists and is tagged with
  12.  
  13. "doctrine.repository_service". at /home/barbet/www/GrandProjet/vendor/doctrine/doctrine-bundle/Repository/ContainerRepositoryFactory.php:71)"} []
  14.  
  15. <?php
  16.  
  17. namespace AppEntity;
  18.  
  19. use DoctrineORMMapping as ORM;
  20. use SymfonyComponentSecurityCoreUserUserInterface;
  21.  
  22. /**
  23. * @ORMEntity(repositoryClass="AppRepositoryUserRepository")
  24. * @ORMTable(name="user")
  25. */
  26. class User implements UserInterface, Serializable
  27. {
  28. /**
  29. * @var int
  30. *
  31. * @ORMId
  32. * @ORMGeneratedValue
  33. * @ORMColumn(type="integer")
  34. */
  35. private $id;
  36.  
  37. /**
  38. * @ORMColumn(type="string", length=255)
  39. */
  40. private $LastName;
  41.  
  42. /**
  43. * @ORMColumn(type="string", length=255)
  44. */
  45. private $FirstName;
  46.  
  47. /**
  48. * @ORMColumn(type="string", length=255)
  49. */
  50. private $username;
  51.  
  52. /**
  53. * @ORMColumn(type="string", length=255)
  54. */
  55. private $password;
  56.  
  57. /**
  58. * @ORMColumn(type="string", length=255)
  59. */
  60. private $Grants;
  61.  
  62. /**
  63. * @ORMColumn(type="string", length=255)
  64. */
  65. private $Status;
  66.  
  67. /**
  68. * @ORMColumn(type="datetime", nullable=true)
  69. */
  70. private $LastUpdateDate;
  71.  
  72. /**
  73. * @ORMColumn(type="string", length=255)
  74. */
  75. private $eMAil;
  76.  
  77. /**
  78. * @ORMColumn(type="string", length=255, nullable=true)
  79. */
  80. private $tag;
  81.  
  82.  
  83. public function getLastName(): ?string
  84. {
  85. return $this->LastName;
  86. }
  87.  
  88. public function setLastName(string $LastName): self
  89. {
  90. $this->LastName = $LastName;
  91.  
  92. return $this;
  93. }
  94.  
  95. public function getFirstName(): ?string
  96. {
  97. return $this->FirstName;
  98. }
  99.  
  100. public function setFirstName(string $FirstName): self
  101. {
  102. $this->FirstName = $FirstName;
  103.  
  104. return $this;
  105. }
  106.  
  107. public function getusername(): ?string
  108. {
  109. return $this->username;
  110. }
  111.  
  112. public function setusername(string $username): self
  113. {
  114. $this->username = $username;
  115.  
  116. return $this;
  117. }
  118.  
  119. public function getpassword(): ?string
  120. {
  121. return $this->password;
  122. }
  123.  
  124. public function setpassword(string $password): self
  125. {
  126. $this->password = $password;
  127.  
  128. return $this;
  129. }
  130.  
  131. public function getGrants(): ?string
  132. {
  133. return $this->Grants;
  134. }
  135.  
  136. public function setGrants(string $Grants): self
  137. {
  138. $this->Grants = $Grants;
  139.  
  140. return $this;
  141. }
  142.  
  143. public function getStatus(): ?string
  144. {
  145. return $this->Status;
  146. }
  147.  
  148. public function setStatus(string $Status): self
  149. {
  150. $this->Status = $Status;
  151.  
  152. return $this;
  153. }
  154.  
  155. public function getLastUpdateDate(): ?DateTimeInterface
  156. {
  157. return $this->LastUpdateDate;
  158. }
  159.  
  160. public function setLastUpdateDate(?DateTimeInterface $LastUpdateDate): self
  161. {
  162. $this->LastUpdateDate = $LastUpdateDate;
  163.  
  164. return $this;
  165. }
  166.  
  167. public function getEMAil(): ?string
  168. {
  169. return $this->eMAil;
  170. }
  171.  
  172. public function setEMAil(string $eMAil): self
  173. {
  174. $this->eMAil = $eMAil;
  175.  
  176. return $this;
  177. }
  178.  
  179. public function getTag(): ?string
  180. {
  181. return $this->tag;
  182. }
  183.  
  184. public function setTag(?string $tag): self
  185. {
  186. $this->tag = $tag;
  187.  
  188. return $this;
  189. }
  190.  
  191.  
  192. /**
  193. * @var array
  194. *
  195. * @ORMColumn(type="string")
  196. */
  197. private $roles = [];
  198.  
  199.  
  200.  
  201. public function getId(): int
  202. {
  203. return $this->id;
  204. }
  205.  
  206.  
  207. /**
  208. * Retourne les rôles de l'user
  209. */
  210. public function getRoles(): array
  211. {
  212. $roles = $this->roles;
  213.  
  214. // Afin d'être sûr qu'un user a toujours au moins 1 rôle
  215. if (empty($roles)) {
  216. $roles = 'User';
  217. }
  218.  
  219. return array_unique($roles);
  220. }
  221.  
  222. public function setRoles(string $roles): self
  223. {
  224. $this->roles = $roles;
  225. return $this;
  226. }
  227.  
  228. /**
  229. * Retour le salt qui a servi à coder le mot de passe
  230. *
  231. * {@inheritdoc}
  232. */
  233. public function getSalt(): ?string
  234. {
  235. // See "Do you need to use a Salt?" at https://symfony.com/doc/current/cookbook/security/entity_provider.html
  236. // we're using bcrypt in security.yml to encode the password, so
  237. // the salt value is built-in and you don't have to generate one
  238.  
  239. return null;
  240. }
  241.  
  242. /**
  243. * Removes sensitive data from the user.
  244. *
  245. * {@inheritdoc}
  246. */
  247. public function eraseCredentials(): void
  248. {
  249. // Nous n'avons pas besoin de cette methode car nous n'utilions pas de plainpassword
  250. // Mais elle est obligatoire car comprise dans l'interface UserInterface
  251. // $this->plainpassword = null;
  252. }
  253.  
  254. /**
  255. * {@inheritdoc}
  256. */
  257. public function serialize(): string
  258. {
  259. return serialize([$this->id, $this->username, $this->password]);
  260. }
  261.  
  262. /**
  263. * {@inheritdoc}
  264. */
  265. public function unserialize($serialized): void
  266. {
  267. [$this->id, $this->login, $this->password] = unserialize($serialized, ['allowed_classes' => false]);
  268. }
  269. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement