@@ -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); | |||
} | |||
} |
@@ -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(); | |||
} | |||
} |