classColumnRef
final class ColumnRef
One end of a relation: a table and the columns of it that take part.
Written order.id, or order.(shop_id, no) for a composite key, following the reference syntax of DBML.
Properties§
public string $tablepublic list<string> $columnsMethods§
public function __construct(public string $table, public list<string> $columns)Parameters
$table | string | |
$columns | list<string> |
Calls 2
public static function of(string $table, string ...$columns): selfReturns of.
Parameters
$table | string | |
$columns | string |
Returns
selfTest cases 33
GeneratedColumnReferenceExceptionTest::testDescribesGeneratedColumnReferencecallsMissingRelationValueExceptionTest::testDescribesMissingRelationValuecallsUnknownPlanColumnExceptionTest::testDescribesUnknownPlanColumncallsPlanSchemaExceptionTest::testGeneratedColumnExplainsWhyItCannotCarryAValuecallsPlanSchemaExceptionTest::testMissingValueNamesBothEndscallsPlanSchemaExceptionTest::testUnknownColumnNamesTheLinkTheTableAndWhatItDoesHavecallsColumnRefTest::testCastsToItsWrittenFormcallsColumnRefTest::testEqualsComparesTableAndColumnscallsColumnRefTest::testIsCompositeASingleColumnIsNotCompositecallsColumnRefTest::testOfBuildsFromVariadicColumnscallsColumnRefTest::testOfKeepsColumnsInTheOrderGivencallsColumnRefTest::testOfReindexesColumnsSpreadFromAKeyedArraycallsColumnRefTest::testPrintsCompositeColumnsInParenthesescallsColumnRefTest::testSeveralColumnsAreCompositecallsColumnRefTest::testToStringPrintsASingleColumnWithADotcallsCompositeArityMismatchExceptionTest::testDescribesCompositeArityMismatchcallsDuplicateColumnBindingExceptionTest::testDescribesDuplicateColumnBindingcallsFixturePlanTest::testWithRelationAcceptsAColumnRefForCompositeKeyscallsPlanStructureExceptionTest::testColumnsBoundTwiceNamesTheColumnAndBothParentscallsPlanSyntaxExceptionTest::testCompositeArityMismatchReportsBothCountscallsRelationTest::testASelfReferenceNamesItsTableOncecallsRelationTest::testBothSidesAreRequiredByDefaultcallsRelationTest::testChildIsCollectionOnlyOneToOneHoldsASingleChildRowcallsRelationTest::testChildIsOptionalAMarkerNextToTheChildMakesTheChildOptionalcallsRelationTest::testColumnMapPairsCompositeKeysPositionallycallsRelationTest::testColumnMapPointsChildColumnsAtParentColumnscallsRelationTest::testColumnMapReadsTheSameWrittenEitherWaycallsRelationTest::testKeepsTheSidesInTheOrderTheyWereWrittencallsRelationTest::testManyToOneDescribesTheSameShapeWrittenBackwardscallsRelationTest::testNamedConstructorsAlsoTakeColumnRefscallsRelationTest::testOneToManyMakesTheLeftSideTheParentcallsRelationTest::testParentIsOptionalAMarkerNextToTheParentMakesTheParentOptionalcallsRelationTest::testTablesListsBothEndscalls
public static function from(string $reference): selfRead an endpoint written as order.id or order.(shop_id, no).
Parameters
$reference | string |
Returns
selfTest cases 5
Called from 6
- static-call SqlFixture\Plan\Relation::oneToMany() packages/sql-fixture/src/Plan/Relation.php:45
- static-call SqlFixture\Plan\Relation::oneToMany() packages/sql-fixture/src/Plan/Relation.php:47
- static-call SqlFixture\Plan\Relation::manyToOne() packages/sql-fixture/src/Plan/Relation.php:62
- static-call SqlFixture\Plan\Relation::manyToOne() packages/sql-fixture/src/Plan/Relation.php:64
- static-call SqlFixture\Plan\Relation::oneToOne() packages/sql-fixture/src/Plan/Relation.php:79
- static-call SqlFixture\Plan\Relation::oneToOne() packages/sql-fixture/src/Plan/Relation.php:81
Calls 12
- function-call
strposline 49 - new UnexpectedPlanTokenException line 51
- function-call
strlenline 51 - function-call
trimline 54 - function-call
substrline 54 - function-call
str_starts_withline 57 - function-call
str_ends_withline 58 - function-call
array_valuesline 65 - function-call
array_filterline 65 - function-call
array_mapline 65 - function-call
explodeline 67 - new
selfline 70
public function isComposite(): boolpublic function equals(self $other): boolWhether both ends name the same table and columns.
Parameters
$other | self |
Returns
boolpublic function toString(): stringReturns to string.
Returns
stringCalled from 8
- method-call SqlFixture\Fixture\Exception\GeneratedColumnReferenceException::__construct() packages/sql-fixture/src/Fixture/Exception/GeneratedColumnReferenceException.php:28
- method-call SqlFixture\Fixture\Exception\UnknownPlanColumnException::__construct() packages/sql-fixture/src/Fixture/Exception/UnknownPlanColumnException.php:26
- method-call SqlFixture\Plan\ColumnRef::__toString() packages/sql-fixture/src/Plan/ColumnRef.php:106
- method-call SqlFixture\Plan\Exception\CompositeArityMismatchException::__construct() packages/sql-fixture/src/Plan/Exception/CompositeArityMismatchException.php:24
- method-call SqlFixture\Plan\Exception\CompositeArityMismatchException::__construct() packages/sql-fixture/src/Plan/Exception/CompositeArityMismatchException.php:25
- method-call SqlFixture\Plan\Exception\DuplicateColumnBindingException::__construct() packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:26
- method-call SqlFixture\Plan\Exception\DuplicateColumnBindingException::__construct() packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:27
- method-call SqlFixture\Plan\Exception\DuplicateColumnBindingException::__construct() packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:28
Calls 2
- method-call ColumnRef::isComposite() line 94
- function-call
implodeline 98
public function __toString(): stringReturns the canonical textual representation.
Returns
stringCalls 1
- method-call ColumnRef::toString() line 106
Test cases 64§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 15
ColumnRefTest::testCastsToItsWrittenFormcallsColumnRefTest::testEqualsComparesTableAndColumnscallsColumnRefTest::testFromDropsEmptyEntriesWithoutLeavingGapsInTheListcallsColumnRefTest::testFromIgnoresSpaceAroundACompositeListcallsColumnRefTest::testFromReadsACompositeEndpointcallsColumnRefTest::testFromReadsASingleColumnEndpointcallsColumnRefTest::testFromStripsQuotingcallsColumnRefTest::testIsCompositeASingleColumnIsNotCompositecallsColumnRefTest::testNamesATableAndItsColumnscallsColumnRefTest::testOfBuildsFromVariadicColumnscallsColumnRefTest::testOfKeepsColumnsInTheOrderGivencallsColumnRefTest::testOfReindexesColumnsSpreadFromAKeyedArraycallsColumnRefTest::testPrintsCompositeColumnsInParenthesescallsColumnRefTest::testSeveralColumnsAreCompositecallsColumnRefTest::testToStringPrintsASingleColumnWithADotcalls
Other tests reaching this symbol 49
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsGeneratedColumnReferenceExceptionTest::testDescribesGeneratedColumnReferencecallsMissingRelationValueExceptionTest::testDescribesMissingRelationValuecallsUnknownPlanColumnExceptionTest::testDescribesUnknownPlanColumncallsConnectedTablesTestcallsOverrideSpecsTestcallsRelationCountsTestcallsRelationProjectionTestcallsRowMaterializerTestcallsGenerationRunTestcallsPlanGeneratorTestcallsPlanSchemaExceptionTest::testGeneratedColumnExplainsWhyItCannotCarryAValuecallsPlanSchemaExceptionTest::testMissingValueNamesBothEndscallsPlanSchemaExceptionTest::testUnknownColumnNamesTheLinkTheTableAndWhatItDoesHavecallsPlanSchemaValidatorTestcallsEndpointValidatorTest::testCheckEndpointAcceptsDeclaredLinkColumnscallsFixtureProviderTestcallsConstructorHydrationTestcallsPropertyHydrationTestcallsCompositeArityMismatchExceptionTest::testDescribesCompositeArityMismatchcallsDuplicateColumnBindingExceptionTest::testDescribesDuplicateColumnBindingcallsFixturePlanTest::testWithRelationAcceptsAColumnRefForCompositeKeyscallsPlanStatementsTestcallsRelationCursorTestcallsRelationReaderTest::testBuildRelationsCarriesOptionalityToEachTargetcallsPlanParserTestcallsPlanPrinterTestcallsPlanStructureExceptionTest::testColumnsBoundTwiceNamesTheColumnAndBothParentscallsPlanSyntaxExceptionTest::testCompositeArityMismatchReportsBothCountscallsPlanTablesTestcallsRelationGroupsTest::testOperatorPreservesBothMarkerscallsStatementPrinterTestcallsRelationTest::testASelfReferenceNamesItsTableOncecallsRelationTest::testBothSidesAreRequiredByDefaultcallsRelationTest::testChildIsCollectionOnlyOneToOneHoldsASingleChildRowcallsRelationTest::testChildIsOptionalAMarkerNextToTheChildMakesTheChildOptionalcallsRelationTest::testColumnMapPairsCompositeKeysPositionallycallsRelationTest::testColumnMapPointsChildColumnsAtParentColumnscallsRelationTest::testColumnMapReadsTheSameWrittenEitherWaycallsRelationTest::testKeepsTheSidesInTheOrderTheyWereWrittencallsRelationTest::testManyToOneDescribesTheSameShapeWrittenBackwardscallsRelationTest::testNamedConstructorsAlsoTakeColumnRefscallsRelationTest::testOneToManyMakesTheLeftSideTheParentcallsRelationTest::testParentIsOptionalAMarkerNextToTheParentMakesTheParentOptionalcallsRelationTest::testTablesListsBothEndscallsPlanValidationTestcallsTableNameTestcallsSqlSchemaProviderTestcalls
Relations§
Instantiated in 2
Static calls 6
- static-call SqlFixture\Plan\Relation::oneToMany() packages/sql-fixture/src/Plan/Relation.php:45
- static-call SqlFixture\Plan\Relation::oneToMany() packages/sql-fixture/src/Plan/Relation.php:47
- static-call SqlFixture\Plan\Relation::manyToOne() packages/sql-fixture/src/Plan/Relation.php:62
- static-call SqlFixture\Plan\Relation::manyToOne() packages/sql-fixture/src/Plan/Relation.php:64
- static-call SqlFixture\Plan\Relation::oneToOne() packages/sql-fixture/src/Plan/Relation.php:79
- static-call SqlFixture\Plan\Relation::oneToOne() packages/sql-fixture/src/Plan/Relation.php:81
Method calls 7
- method-call SqlFixture\Fixture\Exception\GeneratedColumnReferenceException::__construct() packages/sql-fixture/src/Fixture/Exception/GeneratedColumnReferenceException.php:28
- method-call SqlFixture\Fixture\Exception\UnknownPlanColumnException::__construct() packages/sql-fixture/src/Fixture/Exception/UnknownPlanColumnException.php:26
- method-call SqlFixture\Plan\Exception\CompositeArityMismatchException::__construct() packages/sql-fixture/src/Plan/Exception/CompositeArityMismatchException.php:24
- method-call SqlFixture\Plan\Exception\CompositeArityMismatchException::__construct() packages/sql-fixture/src/Plan/Exception/CompositeArityMismatchException.php:25
- method-call SqlFixture\Plan\Exception\DuplicateColumnBindingException::__construct() packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:26
- method-call SqlFixture\Plan\Exception\DuplicateColumnBindingException::__construct() packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:27
- method-call SqlFixture\Plan\Exception\DuplicateColumnBindingException::__construct() packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:28
Type checks 6
- instanceof SqlFixture\Plan\Relation::oneToMany() packages/sql-fixture/src/Plan/Relation.php:45
- instanceof SqlFixture\Plan\Relation::oneToMany() packages/sql-fixture/src/Plan/Relation.php:47
- instanceof SqlFixture\Plan\Relation::manyToOne() packages/sql-fixture/src/Plan/Relation.php:62
- instanceof SqlFixture\Plan\Relation::manyToOne() packages/sql-fixture/src/Plan/Relation.php:64
- instanceof SqlFixture\Plan\Relation::oneToOne() packages/sql-fixture/src/Plan/Relation.php:79
- instanceof SqlFixture\Plan\Relation::oneToOne() packages/sql-fixture/src/Plan/Relation.php:81
Type declarations 28
- type SqlFixture\Fixture\Exception\GeneratedColumnReferenceException packages/sql-fixture/src/Fixture/Exception/GeneratedColumnReferenceException.php:20
- type SqlFixture\Fixture\Exception\MissingRelationValueException packages/sql-fixture/src/Fixture/Exception/MissingRelationValueException.php:20
- type SqlFixture\Fixture\Exception\UnknownPlanColumnException packages/sql-fixture/src/Fixture/Exception/UnknownPlanColumnException.php:20
- type SqlFixture\Fixture\Validation\EndpointValidator packages/sql-fixture/src/Fixture/Validation/EndpointValidator.php:22
- type SqlFixture\Plan\Exception\CompositeArityMismatchException packages/sql-fixture/src/Plan/Exception/CompositeArityMismatchException.php:19
- type SqlFixture\Plan\Exception\CompositeArityMismatchException packages/sql-fixture/src/Plan/Exception/CompositeArityMismatchException.php:20
- type SqlFixture\Plan\Exception\DuplicateColumnBindingException packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:19
- type SqlFixture\Plan\Exception\DuplicateColumnBindingException packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:20
- type SqlFixture\Plan\Exception\DuplicateColumnBindingException packages/sql-fixture/src/Plan/Exception/DuplicateColumnBindingException.php:21
- type SqlFixture\Plan\FixturePlan packages/sql-fixture/src/Plan/FixturePlan.php:140
- type SqlFixture\Plan\FixturePlan packages/sql-fixture/src/Plan/FixturePlan.php:141
- type SqlFixture\Plan\FixturePlan packages/sql-fixture/src/Plan/FixturePlan.php:151
- type SqlFixture\Plan\FixturePlan packages/sql-fixture/src/Plan/FixturePlan.php:152
- type SqlFixture\Plan\FixturePlan packages/sql-fixture/src/Plan/FixturePlan.php:162
- type SqlFixture\Plan\FixturePlan packages/sql-fixture/src/Plan/FixturePlan.php:163
- type SqlFixture\Plan\Parsing\RelationReader packages/sql-fixture/src/Plan/Parsing/RelationReader.php:95
- type SqlFixture\Plan\Parsing\RelationReader packages/sql-fixture/src/Plan/Parsing/RelationReader.php:139
- type SqlFixture\Plan\Parsing\RelationReader::buildRelations() packages/sql-fixture/src/Plan/Parsing/RelationReader.php:146
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:25
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:27
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:40
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:41
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:57
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:58
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:74
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:75
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:110
- type SqlFixture\Plan\Relation packages/sql-fixture/src/Plan/Relation.php:118