| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Protocol\Planning; |
| 6: | |
| 7: | use LaravelUi5\OData\Protocol\Planning\Expression\LiteralExpression; |
| 8: | |
| 9: | final readonly class KeyExpression |
| 10: | { |
| 11: | /** |
| 12: | * @param array<string, LiteralExpression> $values Property name → literal. |
| 13: | * Single-key entity: ['id' => new LiteralExpression(42, 'Edm.Int32')] |
| 14: | */ |
| 15: | public function __construct(public readonly array $values) {} |
| 16: | |
| 17: | public function isSingleKey(): bool |
| 18: | { |
| 19: | return count($this->values) === 1; |
| 20: | } |
| 21: | } |
| 22: |