瀏覽代碼

Ticket : gestion visitorToken

develop
Guillaume 3 年之前
父節點
當前提交
36574b7f04
共有 2 個文件被更改,包括 18 次插入0 次删除
  1. +7
    -0
      Repository/Ticket/TicketRepositoryQuery.php
  2. +11
    -0
      Repository/Ticket/TicketStore.php

+ 7
- 0
Repository/Ticket/TicketRepositoryQuery.php 查看文件

@@ -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 查看文件

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

Loading…
取消
儲存