示例#1
0
 /**
  * Add the match clause for a relationship
  *
  * @param IdentityInterface $identity
  * @param object $entity
  * @param Relationship $meta
  * @param CollectionInterface $changeset
  * @param Query $query
  *
  * @return Query
  */
 private function matchRelationship(IdentityInterface $identity, $entity, Relationship $meta, CollectionInterface $changeset, Query $query) : Query
 {
     $name = $this->name->sprintf(md5($identity->value()));
     $this->variables = $this->variables->put($name, $this->buildProperties($changeset, $meta->properties()));
     return $query->match()->linkedTo()->through((string) $meta->type(), (string) $name)->withProperty($meta->identity()->property(), (string) $name->prepend('{')->append('_identity}'))->withParameter((string) $name->append('_identity'), $identity->value());
 }