Skip to content

Commit

Permalink
add some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
clementtalleu committed Jun 26, 2024
1 parent 0b67c62 commit eb4b8a6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/advanced_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $userRepository->getPropertyValue(identifier: 3, property: 'name');
// ⚠️ Warning: this method cannot retrieve array or nested objects when HASH format
```

You can also request objects or collection by nested objects properties
#### You can also request objects or collection by nested objects properties
```php
// Will retrieve 1 user from the category called 'CUSTOMER'
$userRepository->findOneBy(['category_name' => 'CUSTOMER']);
Expand All @@ -71,6 +71,19 @@ $userRepository->findOneBy(['category_name' => 'CUSTOMER']);
$userRepository->findBy(['category_id' => 3]);
```

#### Request by date
⚠️ Warning, this kind of request is only available with JSON format mapping
```php

// Will retrieve users from datetime
$userRepository->findOneBy(['createdAt' => new DateTime('2021-01-01 00:00:00')]);
$userRepository->findBy(['createdAt' => new DateTime('2021-01-01 00:00:00')]);

// Will retrieve users by datetime as string
$userRepository->findOneBy(['createdAt' => '2021-01-01 00:00:00']);
$userRepository->findBy(['createdAt' => '2021-01-01 00:00:00']);
```

## Repository

You can create your own repository to query your objects in Redis. Then inject it in the
Expand Down

0 comments on commit eb4b8a6

Please sign in to comment.