Skip to content

Commit

Permalink
Update Reader.php to include filter by user
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanApunts authored Jul 3, 2024
1 parent 0a35944 commit c040a9e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Provider/Doctrine/Persistence/Reader/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public function createQuery(string $entity, array $options = []): Query
$query->addFilter(new SimpleFilter(Query::OBJECT_ID, $config['object_id']));
}

if (null !== $config['user_id']) {
$query->addFilter(new SimpleFilter(Query::USER_ID, $config['user_id']));
}

if (null !== $config['transaction_hash']) {
$query->addFilter(new SimpleFilter(Query::TRANSACTION_HASH, $config['transaction_hash']));
}
Expand Down Expand Up @@ -181,13 +185,15 @@ private function configureOptions(OptionsResolver $resolver): void
->setDefaults([
'type' => null,
'object_id' => null,
'user_id' => null,
'transaction_hash' => null,
'page' => 1,
'page_size' => self::PAGE_SIZE,
'strict' => true,
])
->setAllowedTypes('type', ['null', 'string', 'array'])
->setAllowedTypes('object_id', ['null', 'int', 'string', 'array'])
->setAllowedTypes('user_id', ['null', 'int', 'string', 'array'])
->setAllowedTypes('transaction_hash', ['null', 'string', 'array'])
->setAllowedTypes('page', ['null', 'int'])
->setAllowedTypes('page_size', ['null', 'int'])
Expand Down

0 comments on commit c040a9e

Please sign in to comment.