Browse Source

Correctif Reminder

develop
Guillaume 3 years ago
parent
commit
1b1b90fba6
2 changed files with 25 additions and 28 deletions
  1. +0
    -25
      Repository/Reminder/ReminderRepositoryQuery.php
  2. +25
    -3
      Repository/Reminder/ReminderStore.php

+ 0
- 25
Repository/Reminder/ReminderRepositoryQuery.php View File

@@ -12,31 +12,6 @@ class ReminderRepositoryQuery extends AbstractRepositoryQuery implements Reminde
parent::__construct($repository, 'r', $paginator);
}

public function filterBase($params = [])
{
$this->filterDone();

if(array_key_exists('user', $params)) {
$this->filterUser($params['user']);
}

if(array_key_exists('crudAction', $params)) {
$this->filterCrudAction($params['crudAction']);
}

if(array_key_exists('crudControllerFqcn', $params)) {
$this->filterCrudControllerFqcn($params['crudControllerFqcn']);
}

if(array_key_exists('entityId', $params)) {
$this->filterEntityId($params['entityId']);
}

$this->orderDefault();

return $this;
}

public function filterDone($done = false)
{
return $this

+ 25
- 3
Repository/Reminder/ReminderStore.php View File

@@ -11,10 +11,32 @@ class ReminderStore implements ReminderStoreInterface
$this->query = $query;
}

public function get($params = [])
public function get($params = [], $query = null)
{
$query = $this->query->create();
$query->filterBase($params) ;
if(is_null($query)) {
$query = $this->query->create();
}

$query->filterDone();

if(array_key_exists('user', $params)) {
$query->filterUser($params['user']);
}

if(array_key_exists('crudAction', $params)) {
$query->filterCrudAction($params['crudAction']);
}

if(array_key_exists('crudControllerFqcn', $params)) {
$query->filterCrudControllerFqcn($params['crudControllerFqcn']);
}

if(array_key_exists('entityId', $params)) {
$query->filterEntityId($params['entityId']);
}

$query->orderDefault();

return $query->find();
}


Loading…
Cancel
Save