浏览代码

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

正在加载...
取消
保存