abstract class ConverterBase implements ConverterInterface (View source)

Base class for PHPCR based query converters.

Properties

protected SourceInterface $from
protected ColumnInterface[] $columns
protected OrderingInterface[] $orderings
protected ConstraintInterface $constraint

Methods

array
getPhpcrProperty(string $originalAlias, string $odmField)

Return the PHPCR property name and alias for the given ODM document property name and query alias.

walkSourceDocument(SourceDocument $node)

Walk the source document.

walkOperandDynamicField(OperandDynamicField $node)

Walk the dynamic field.

QueryObjectModelFactoryInterface
qomf()

Return the query object model factory.

string
validateAlias(string $alias)

Check that the given alias is valid and return it.

dispatchMany(array $nodes)

Convenience method to dispatch an array of nodes.

object
dispatch(AbstractNode $node)

Dispatch a node.

walkSelect(AbstractNode $node)

No description

walkSelectAdd(SelectAdd $node)

No description

walkFrom(AbstractNode $node)

No description

walkWhere(Where $where)

No description

walkWhereAnd(WhereAnd $whereAnd)

No description

walkWhereOr(WhereOr $whereOr)

No description

walkSourceJoin(SourceJoin $node)

No description

walkSourceJoinLeft(SourceJoinLeft $node)

No description

walkSourceJoinRight(SourceJoinRight $node)

No description

doWalkConstraintComposite(AbstractNode $node, $method)

No description

walkConstraintAndX(ConstraintAndX $node)

No description

walkConstraintOrX(ConstraintOrX $node)

No description

walkConstraintSame(ConstraintSame $node)

No description

walkConstraintChild(ConstraintChild $node)

No description

walkConstraintNot(ConstraintNot $node)

No description

walkOrderBy(OrderBy $node)

No description

walkOrderByAdd(OrderBy $node)

No description

Details

abstract protected array getPhpcrProperty(string $originalAlias, string $odmField)

Return the PHPCR property name and alias for the given ODM document property name and query alias.

The alias might change if this is a translated field and the strategy needs to do a join to get in the translation.

Parameters

string $originalAlias As specified in the query source.
string $odmField Name of ODM document property.

Return Value

array first element is the real alias to use, second element is the property name

Exceptions

Exception If a field used in the query does not exist on the document.

abstract protected walkSourceDocument(SourceDocument $node)

Walk the source document.

Parameters

SourceDocument $node

abstract protected walkOperandDynamicField(OperandDynamicField $node)

Walk the dynamic field.

Implementations should map their domain field name to the PHPCR field name here.

Parameters

OperandDynamicField $node

abstract protected QueryObjectModelFactoryInterface qomf()

Return the query object model factory.

Return Value

QueryObjectModelFactoryInterface

abstract protected string validateAlias(string $alias)

Check that the given alias is valid and return it.

This should only be called from the getQuery function AFTER the document sources are known.

Parameters

string $alias Alias to validate and return

Return Value

string Return the alias to allow this function to be used inline

Exceptions

InvalidArgumentException

protected dispatchMany(array $nodes)

Convenience method to dispatch an array of nodes.

Parameters

array $nodes

object dispatch(AbstractNode $node)

Dispatch a node.

This method will look for a method of the form "walk{NodeType}" in this class and then use that to build the PHPCR QOM counterpart of the given node.

Parameters

AbstractNode $node

Return Value

object
  • PHPCR QOM object

walkSelect(AbstractNode $node)

Parameters

AbstractNode $node

walkSelectAdd(SelectAdd $node)

Parameters

SelectAdd $node

walkFrom(AbstractNode $node)

Parameters

AbstractNode $node

walkWhere(Where $where)

Parameters

Where $where

walkWhereAnd(WhereAnd $whereAnd)

Parameters

WhereAnd $whereAnd

walkWhereOr(WhereOr $whereOr)

Parameters

WhereOr $whereOr

protected walkSourceJoin(SourceJoin $node)

Parameters

SourceJoin $node

protected walkSourceJoinLeft(SourceJoinLeft $node)

Parameters

SourceJoinLeft $node

protected walkSourceJoinRight(SourceJoinRight $node)

Parameters

SourceJoinRight $node

protected walkSourceJoinConditionFactory(SourceJoinConditionFactory $node)

Parameters

SourceJoinConditionFactory $node

protected walkSourceJoinConditionEqui(SourceJoinConditionEqui $node)

Parameters

SourceJoinConditionEqui $node

protected walkSourceJoinConditionDescendant(SourceJoinConditionDescendant $node)

protected walkSourceJoinConditionChildDocument(SourceJoinConditionChildDocument $node)

protected walkSourceJoinConditionSameDocument(SourceJoinConditionSameDocument $node)

protected doWalkConstraintComposite(AbstractNode $node, $method)

Parameters

AbstractNode $node
$method

protected walkConstraintAndX(ConstraintAndX $node)

Parameters

ConstraintAndX $node

protected walkConstraintOrX(ConstraintOrX $node)

Parameters

ConstraintOrX $node

protected walkConstraintFieldIsset(ConstraintFieldIsset $node)

Parameters

ConstraintFieldIsset $node

protected walkConstraintFullTextSearch(ConstraintFullTextSearch $node)

Parameters

ConstraintFullTextSearch $node

protected walkConstraintSame(ConstraintSame $node)

Parameters

ConstraintSame $node

protected walkConstraintDescendant(ConstraintDescendant $node)

Parameters

ConstraintDescendant $node

protected walkConstraintChild(ConstraintChild $node)

Parameters

ConstraintChild $node

protected walkConstraintComparison(ConstraintComparison $node)

Parameters

ConstraintComparison $node

protected walkConstraintNot(ConstraintNot $node)

Parameters

ConstraintNot $node

protected walkOperandDynamicLocalName(OperandDynamicLocalName $node)

Parameters

OperandDynamicLocalName $node

protected walkOperandDynamicFullTextSearchScore(OperandDynamicFullTextSearchScore $node)

protected walkOperandDynamicLength(OperandDynamicLength $node)

Parameters

OperandDynamicLength $node

protected walkOperandDynamicName(OperandDynamicName $node)

Parameters

OperandDynamicName $node

protected walkOperandDynamicLowerCase(OperandDynamicLowerCase $node)

Parameters

OperandDynamicLowerCase $node

protected walkOperandDynamicUpperCase(OperandDynamicUpperCase $node)

Parameters

OperandDynamicUpperCase $node

protected walkOperandStaticLiteral(OperandStaticLiteral $node)

Parameters

OperandStaticLiteral $node

protected walkOperandStaticParameter(OperandStaticParameter $node)

Parameters

OperandStaticParameter $node

protected walkOrderBy(OrderBy $node)

Parameters

OrderBy $node

protected walkOrderByAdd(OrderBy $node)

Parameters

OrderBy $node