classAliasTarget
final class AliasTarget
implements Resolution
uses Snapshot
Public API: explicitly declared with
@visibility public.A name that resolves to an output field of the same query by its alias.
The reference stays a reference: the aliased expression is not copied to the use position.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT 1 AS x ORDER BY x');
$query->facts->scalar($query->statement->orderBy[0]->expression)->resolution->field === $query->field('x') // => trueProperties§
public Field $fieldMethods§
Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 14
ColumnResolverTest::testAliasTreatsItemsComputingTheSameExpressionAsOnecallsColumnResolverTest::testFactAnswersTheFactsOfTheColumnOrTheProblemcallsColumnResolverTest::testFindFallsBackToTheAliasOfASelectListItemcallsColumnResolverTest::testFindIgnoresAliasesForAQualifiedNamecallsExpressionFactsTest::testDeriveResolvesTheOrderingAgainstTheOutputAndBindsTheTablescallsResultReferencesTest::testSelectedResolvesAColumnItemToItsColumnAndAnotherItemToTheItemcallsResultReferencesTest::testUndecidedKeepsAResolvedMatchAsCandidatecallsSelectFactsTest::testDeriveResolvesAnOrderingByTheTextAnItemIsNamedAftercallsSelectFactsTest::testDeriveScopesEveryClausecallsSortScopesTest::testDeriveResolvesOrdinalsAliasesAndColumnscallsColumnUseTest::testDeriveScalarAnswersTheFactsOfTheItemAnAliasNamescallsOutputOrdinalTest::testDeriveScalarTakesTheFactsOfTheFieldcallsQueryExpressionTest::testDeriveQueryResolvesOrdinalsAgainstTheOutputcallsOrderedSetOperationTest::testDeriveQueryOrdersTheResultAndKeepsTheClausesOfTheLastSelectcalls
Relations§
Instantiated in 4
- new SqlSemantics\Platform\MySql\Rules\ColumnResolver::alias() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:240
- new SqlSemantics\Platform\MySql\Rules\ColumnResolver::alias() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:244
- new SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::selected() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:98
- new SqlSemantics\Platform\MySql\Statement\Query\Clause\OutputOrdinal::deriveScalar() packages/sql-semantics-mysql/src/Statement/Query/Clause/OutputOrdinal.php:73