Parcourir la source

ticket news user repo

develop
Charly il y a 3 ans
Parent
révision
8139c91dd0
3 fichiers modifiés avec 7 ajouts et 27 suppressions
  1. +0
    -3
      Repository/Site/NewsRepositoryQuery.php
  2. +1
    -19
      Repository/Ticket/TicketStore.php
  3. +6
    -5
      Repository/User/UserRepository.php

+ 0
- 3
Repository/Site/NewsRepositoryQuery.php Voir le fichier

@@ -3,15 +3,12 @@
namespace Lc\SovBundle\Repository\Site;

use Knp\Component\Pager\PaginatorInterface;
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\StatusRepositoryQueryTrait;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class NewsRepositoryQuery extends AbstractRepositoryQuery implements NewsRepositoryQueryInterface
{
use StatusRepositoryQueryTrait;
use MerchantRepositoryQueryTrait;

public function __construct(NewsRepository $repository, PaginatorInterface $paginator)
{

+ 1
- 19
Repository/Ticket/TicketStore.php Voir le fichier

@@ -42,17 +42,8 @@ class TicketStore extends AbstractStore implements TicketStoreInterface
return $query->find();
}

// public function findAllOpen($limit = 0)
// {
// $query = $this->findByMerchantQuery();
// $this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]);
// $query->addOrderBy('e.id', 'DESC');
// $query->setMaxResults($limit);
// return $query->getQuery()->getResult();
// }

//countAllOpen
public function countAllOpen($query = null)
public function countAllOpen($query = null): string
{
if (is_null($query)) {
$query = $this->query->create();
@@ -63,13 +54,4 @@ class TicketStore extends AbstractStore implements TicketStoreInterface

return $query->count();
}


// public function countAllOpen()
// {
// $query = $this->findByMerchantQuery();
// $query->select('count(e.id)');
// $this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]);
// return $query->getQuery()->getSingleScalarResult();
// }
}

+ 6
- 5
Repository/User/UserRepository.php Voir le fichier

@@ -29,11 +29,12 @@ class UserRepository extends AbstractRepository
$this->_em->flush();
}

public function findByRole($role) {
public function findByRole($role)
{
return $this->createQueryBuilder('u')
->andWhere('u.roles LIKE :role')
->setParameter('role', '%'.$role.'%')
->getQuery()
->getResult();
->andWhere('u.roles LIKE :role')
->setParameter('role', '%' . $role . '%')
->getQuery()
->getResult();
}
}

Chargement…
Annuler
Enregistrer