| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\HelloAsso;
- use App\Entity\Organization\Organization;
- use App\Entity\Traits\CreatedOnAndByTrait;
- use App\Repository\HelloAsso\HelloAssoRepository;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * HelloAsso entity for storing HelloAsso connection information.
- *
- * @see https://dev.helloasso.com/docs/mire-authorisation
- */
- #[ORM\Entity(repositoryClass: HelloAssoRepository::class)]
- #[ORM\Table]
- class HelloAsso
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\OneToOne(targetEntity: Organization::class, inversedBy: 'helloAsso')]
- #[ORM\JoinColumn(name: 'organization_id', referencedColumnName: 'id', nullable: false)]
- private Organization $organization;
- /**
- * La valeur utilisée pour générer le challenge PCKE; à conserver en base le temps de l'authentification HelloAsso.
- * @var string|null
- */
- #[ORM\Column(type: 'text', nullable: true)]
- private ?string $challengeVerifier = null;
- /**
- * Le token d'authentification HelloAsso, valable 30min.'
- * @var string|null
- */
- #[ORM\Column(type: 'text', nullable: true)]
- private ?string $token = null;
- /**
- * Date à laquelle le token a été généré
- * @var \DateTimeInterface|null
- */
- #[ORM\Column(type: 'datetime', nullable: true)]
- private $tokenCreatedAt;
- /**
- * Un autre jeton, valable 30jours, permettant de regénérer le token d'authentification HelloAsso.'
- * @var string|null
- */
- #[ORM\Column(type: 'text', nullable: true)]
- private ?string $refreshToken = null;
- /**
- * Date à laquelle le refreshToken a été généré
- * @var \DateTimeInterface|null
- */
- #[ORM\Column(type: 'datetime', nullable: true)]
- private $refreshTokenCreatedAt;
- /**
- * Le slug de l'organisation sur HelloAsso.
- * @var string|null
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- private ?string $organizationSlug = null;
- public function getId(): ?int
- {
- return $this->id;
- }
- public function setId(?int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getOrganization(): Organization
- {
- return $this->organization;
- }
- public function setOrganization(Organization $organization): self
- {
- $this->organization = $organization;
- return $this;
- }
- public function getChallengeVerifier(): ?string
- {
- return $this->challengeVerifier;
- }
- public function setChallengeVerifier(?string $challengeVerifier): self
- {
- $this->challengeVerifier = $challengeVerifier;
- return $this;
- }
- public function getToken(): ?string
- {
- return $this->token;
- }
- public function setToken(?string $token): self
- {
- $this->token = $token;
- return $this;
- }
- public function getTokenCreatedAt(): ?\DateTimeInterface
- {
- return $this->tokenCreatedAt;
- }
- public function setTokenCreatedAt(?\DateTimeInterface $tokenCreatedAt): self
- {
- $this->tokenCreatedAt = $tokenCreatedAt;
- return $this;
- }
- public function getRefreshToken(): ?string
- {
- return $this->refreshToken;
- }
- public function setRefreshToken(?string $refreshToken): self
- {
- $this->refreshToken = $refreshToken;
- return $this;
- }
- public function getRefreshTokenCreatedAt(): ?\DateTimeInterface
- {
- return $this->refreshTokenCreatedAt;
- }
- public function setRefreshTokenCreatedAt(?\DateTimeInterface $refreshTokenCreatedAt): self
- {
- $this->refreshTokenCreatedAt = $refreshTokenCreatedAt;
- return $this;
- }
- public function getOrganizationSlug(): ?string
- {
- return $this->organizationSlug;
- }
- public function setOrganizationSlug(?string $organizationSlug): self
- {
- $this->organizationSlug = $organizationSlug;
- return $this;
- }
- }
|