private function buildSubPropertyCondition(ComparatorInterface $specification) : SequenceInterface { $prop = new Str($specification->property()); $pieces = $prop->split('.'); $var = (new Str('entity_'))->append($pieces->pop()->join('_')); $key = $var->append('_')->append((string) $pieces->last())->append((string) $this->count); return new Sequence(sprintf('%s %s %s', $var->append('.')->append((string) $pieces->last()), $specification->sign(), $key->prepend('{')->append('}')), new Collection([(string) $key => $specification->value()])); }
private function buildEdgeCondition(ComparatorInterface $specification, RelationshipEdge $edge, string $side) : SequenceInterface { $key = (new Str($side))->append('_')->append($edge->target())->append((string) $this->count); $value = $specification->value(); if ($value instanceof IdentityInterface) { $value = $value->value(); } return new Sequence(sprintf('%s.%s %s %s', $side, $edge->target(), $specification->sign(), $key->prepend('{')->append('}')), new Collection([(string) $key => $value])); }