Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The "App\Entity\User" entity has a repositoryClass set to "App\Repository\UserRepository",
- 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 "doctrine.repository_service".
- at /home/barbet/www/GrandProjet/vendor/symfony/security/Core/Authentication/Provider/DaoAuthenticationProvider.php:85,
- RuntimeException(code: 0): The "App\Entity\User" entity has a repositoryClass set to "App\Repository\UserRepository",
- 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
- "doctrine.repository_service". at /home/barbet/www/GrandProjet/vendor/doctrine/doctrine-bundle/Repository/ContainerRepositoryFactory.php:71)"} []
- <?php
- namespace AppEntity;
- use DoctrineORMMapping as ORM;
- use SymfonyComponentSecurityCoreUserUserInterface;
- /**
- * @ORMEntity(repositoryClass="AppRepositoryUserRepository")
- * @ORMTable(name="user")
- */
- class User implements UserInterface, Serializable
- {
- /**
- * @var int
- *
- * @ORMId
- * @ORMGeneratedValue
- * @ORMColumn(type="integer")
- */
- private $id;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $LastName;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $FirstName;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $username;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $password;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $Grants;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $Status;
- /**
- * @ORMColumn(type="datetime", nullable=true)
- */
- private $LastUpdateDate;
- /**
- * @ORMColumn(type="string", length=255)
- */
- private $eMAil;
- /**
- * @ORMColumn(type="string", length=255, nullable=true)
- */
- private $tag;
- public function getLastName(): ?string
- {
- return $this->LastName;
- }
- public function setLastName(string $LastName): self
- {
- $this->LastName = $LastName;
- return $this;
- }
- public function getFirstName(): ?string
- {
- return $this->FirstName;
- }
- public function setFirstName(string $FirstName): self
- {
- $this->FirstName = $FirstName;
- return $this;
- }
- public function getusername(): ?string
- {
- return $this->username;
- }
- public function setusername(string $username): self
- {
- $this->username = $username;
- return $this;
- }
- public function getpassword(): ?string
- {
- return $this->password;
- }
- public function setpassword(string $password): self
- {
- $this->password = $password;
- return $this;
- }
- public function getGrants(): ?string
- {
- return $this->Grants;
- }
- public function setGrants(string $Grants): self
- {
- $this->Grants = $Grants;
- return $this;
- }
- public function getStatus(): ?string
- {
- return $this->Status;
- }
- public function setStatus(string $Status): self
- {
- $this->Status = $Status;
- return $this;
- }
- public function getLastUpdateDate(): ?DateTimeInterface
- {
- return $this->LastUpdateDate;
- }
- public function setLastUpdateDate(?DateTimeInterface $LastUpdateDate): self
- {
- $this->LastUpdateDate = $LastUpdateDate;
- return $this;
- }
- public function getEMAil(): ?string
- {
- return $this->eMAil;
- }
- public function setEMAil(string $eMAil): self
- {
- $this->eMAil = $eMAil;
- return $this;
- }
- public function getTag(): ?string
- {
- return $this->tag;
- }
- public function setTag(?string $tag): self
- {
- $this->tag = $tag;
- return $this;
- }
- /**
- * @var array
- *
- * @ORMColumn(type="string")
- */
- private $roles = [];
- public function getId(): int
- {
- return $this->id;
- }
- /**
- * Retourne les rôles de l'user
- */
- public function getRoles(): array
- {
- $roles = $this->roles;
- // Afin d'être sûr qu'un user a toujours au moins 1 rôle
- if (empty($roles)) {
- $roles = 'User';
- }
- return array_unique($roles);
- }
- public function setRoles(string $roles): self
- {
- $this->roles = $roles;
- return $this;
- }
- /**
- * Retour le salt qui a servi à coder le mot de passe
- *
- * {@inheritdoc}
- */
- public function getSalt(): ?string
- {
- // See "Do you need to use a Salt?" at https://symfony.com/doc/current/cookbook/security/entity_provider.html
- // we're using bcrypt in security.yml to encode the password, so
- // the salt value is built-in and you don't have to generate one
- return null;
- }
- /**
- * Removes sensitive data from the user.
- *
- * {@inheritdoc}
- */
- public function eraseCredentials(): void
- {
- // Nous n'avons pas besoin de cette methode car nous n'utilions pas de plainpassword
- // Mais elle est obligatoire car comprise dans l'interface UserInterface
- // $this->plainpassword = null;
- }
- /**
- * {@inheritdoc}
- */
- public function serialize(): string
- {
- return serialize([$this->id, $this->username, $this->password]);
- }
- /**
- * {@inheritdoc}
- */
- public function unserialize($serialized): void
- {
- [$this->id, $this->login, $this->password] = unserialize($serialized, ['allowed_classes' => false]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement