@@ -361,7 +361,20 @@ public function applyComparison(Builder &$query, Path $path, $parentAttribute =
361361 $ attributeNames = $ path ->getValuePathAttributes ();
362362
363363 if (!empty ($ attributeNames )) {
364- // TODO: search for schema node
364+ $ schemaIdentifier = $ path ->getValuePath ()?->getAttributePath()?->path?->schema ?? null ;
365+
366+ if ($ schemaIdentifier !== null && $ this ->parent === null ) {
367+ $ schemaNode = $ this ->getSubNode ($ schemaIdentifier );
368+
369+ if ($ schemaNode instanceof Schema) {
370+ $ schemaNode ->applyComparison ($ query , $ path );
371+
372+ return ;
373+ }
374+
375+ throw new SCIMException ('Unknown path: ' . (string )$ path . ", in object: " . $ this ->getFullKey ());
376+ }
377+
365378 $ attribute = $ this ->getSubNode ($ attributeNames [0 ]);
366379 if ($ attribute != null ) {
367380 // ($operation, $value, $object, $path->shiftValuePathAttributes());
@@ -379,6 +392,20 @@ public function applyComparison(Builder &$query, Path $path, $parentAttribute =
379392 $ attributeNames = $ path ?->getAttributePath()?->getAttributeNames() ?? [];
380393
381394 if (!empty ($ attributeNames )) {
395+ $ schemaIdentifier = $ path ->getAttributePath ()?->path?->schema ?? null ;
396+
397+ if ($ schemaIdentifier !== null && $ this ->parent === null ) {
398+ $ schemaNode = $ this ->getSubNode ($ schemaIdentifier );
399+
400+ if ($ schemaNode instanceof Schema) {
401+ $ schemaNode ->applyComparison ($ query , $ path );
402+
403+ return ;
404+ }
405+
406+ throw new SCIMException ('Unknown path: ' . (string )$ path . ", in object: " . $ this ->getFullKey ());
407+ }
408+
382409 $ attribute = $ this ->getSubNode ($ attributeNames [0 ]);
383410 if ($ attribute != null ) {
384411 $ attribute ->applyComparison ($ query , $ path ->shiftAttributePathAttributes ());
0 commit comments