Pārlūkot izejas kodu

Ticket : gestion visitorToken

develop
Guillaume pirms 3 gadiem
vecāks
revīzija
36574b7f04
2 mainītis faili ar 18 papildinājumiem un 0 dzēšanām
  1. +7
    -0
      Repository/Ticket/TicketRepositoryQuery.php
  2. +11
    -0
      Repository/Ticket/TicketStore.php

+ 7
- 0
Repository/Ticket/TicketRepositoryQuery.php Parādīt failu

@@ -73,4 +73,11 @@ class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRep
return $this
->select('count(ticket.id) as count');
}

public function filterByVisitorToken(string $visitorToken): self
{
return $this
->andWhere('.visitorToken LIKE :visitorToken')
->setParameter('visitorToken', $visitorToken);
}
}

+ 11
- 0
Repository/Ticket/TicketStore.php Parādīt failu

@@ -66,4 +66,15 @@ class TicketStore extends AbstractStore implements TicketStoreInterface

return $query->count();
}

public function getOneByIdAndVisitorToken(int $id, string $token, $query = null)
{
$query = $this->createDefaultQuery($query);

$query
->filterById($id)
->filterByVisitorToken($token);

return $query->findOne();
}
}

Notiek ielāde…
Atcelt
Saglabāt