Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ phpunit: vendor phpunit-unit phpunit-integration #

.PHONY: phpunit-integration
phpunit-integration: vendor ## run phpunit integration tests
MONGODB_URI="mongodb://localhost:27017" POSTGRES_URI="pgsql:host=localhost;port=5432;dbname=eventstore;user=postgres;password=postgres" vendor/bin/phpunit --testsuite=integrationn --no-coverage
MONGODB_URI="mongodb://localhost:27017" POSTGRES_URI="pgsql:host=localhost;port=5432;dbname=eventstore;user=postgres;password=postgres" vendor/bin/phpunit --testsuite=integration --no-coverage

.PHONY: phpunit-integration-postgres
phpunit-integration-postgres: vendor ## run phpunit integration tests on postgres
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"phpbench/phpbench": "^1.6.1",
"phpstan/phpstan": "^2.1.46",
"phpstan/phpstan-phpunit": "^2.0.16",
"phpunit/phpunit": "^11.5.55"
"phpunit/phpunit": "^11.5.55",
"symfony/var-dumper": "^v7.4.8 || ^v8.0.0"
},
"config": {
"preferred-install": {
Expand Down
151 changes: 120 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions src/Metadata/DocumentMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Patchlevel\ODM\Index;

use function array_is_list;
use function array_keys;
use function array_map;
use function explode;
use function implode;
Expand Down Expand Up @@ -93,16 +94,22 @@ private function propertyPathToFieldPathWithChildren(string $propertyPath, array
{
$parts = explode('.', $propertyPath);
$fieldParts = [];
$mappedPropertyParts = [];

foreach ($parts as $part) {
if (!isset($fields[$part])) {
$fieldParts[] = $part;
$fields = [];
continue;
throw new UnknownPropertyPath(
$this->className,
$propertyPath,
$part,
implode('.', $mappedPropertyParts),
array_keys($fields),
);
}

$field = $fields[$part];
$fieldParts[] = $field->fieldName;
$mappedPropertyParts[] = $part;
$fields = $field->children;
}

Expand Down
Loading
Loading