diff --git a/src/Repositories/PeriodRepository.php b/src/Repositories/PeriodRepository.php index 9b9ed8d..276a7aa 100755 --- a/src/Repositories/PeriodRepository.php +++ b/src/Repositories/PeriodRepository.php @@ -57,13 +57,13 @@ public function findBy(array $params, array $sort = [], int $limit = null, array * @param string $endDate * @return AbstractModel[] */ - public function findAll(array $sort = [], int $limit = null, array $options = []) : array + public function findAll(array $sort = [], int $limit = null, array $options = []) : array { - if (isset($options['options']['element']['type'])) { + if (!isset($options['options']['element']['type'])) { $options['options']['element']['type'] = $this->instance->getCurrentUserType(); } - if (isset($options['options']['element']['id'])) { - $options['options']['element']['type'] = $this->instance->getCurrentUser()->getId(); + if (!isset($options['options']['element']['id'])) { + $options['options']['element']['id'] = $this->instance->getCurrentUser()->getId(); } $data = $this->executionHandler->execute($this, $options); @@ -78,4 +78,4 @@ public function findAll(array $sort = [], int $limit = null, array $options = [] return $data; } -} \ No newline at end of file +}