@@ -3428,9 +3428,9 @@ public function jsonSerialize()
3428
3428
}
3429
3429
}
3430
3430
3431
- // file: src/Tqdev/PhpCrudApi/Record/ColumnSelector .php
3431
+ // file: src/Tqdev/PhpCrudApi/Record/ColumnIncluder .php
3432
3432
3433
- class ColumnSelector
3433
+ class ColumnIncluder
3434
3434
{
3435
3435
3436
3436
private function isMandatory (String $ tableName , String $ columnName , array $ params ): bool
@@ -3473,7 +3473,7 @@ public function getNames(ReflectedTable $table, bool $primaryTable, array $param
3473
3473
{
3474
3474
$ tableName = $ table ->getName ();
3475
3475
$ results = $ table ->columnNames ();
3476
- $ results = $ this ->select ($ tableName , $ primaryTable , $ params , 'columns ' , $ results , true );
3476
+ $ results = $ this ->select ($ tableName , $ primaryTable , $ params , 'include ' , $ results , true );
3477
3477
$ results = $ this ->select ($ tableName , $ primaryTable , $ params , 'exclude ' , $ results , false );
3478
3478
return $ results ;
3479
3479
}
@@ -3772,7 +3772,7 @@ public function __construct(GenericDB $db, ReflectionService $reflection)
3772
3772
{
3773
3773
$ this ->db = $ db ;
3774
3774
$ this ->tables = $ reflection ->getDatabase ();
3775
- $ this ->columns = new ColumnSelector ();
3775
+ $ this ->columns = new ColumnIncluder ();
3776
3776
$ this ->joiner = new RelationJoiner ($ this ->columns );
3777
3777
$ this ->filters = new FilterInfo ();
3778
3778
$ this ->ordering = new OrderingInfo ();
@@ -3876,14 +3876,14 @@ class RelationJoiner
3876
3876
3877
3877
private $ columns ;
3878
3878
3879
- public function __construct (ColumnSelector $ columns )
3879
+ public function __construct (ColumnIncluder $ columns )
3880
3880
{
3881
3881
$ this ->columns = $ columns ;
3882
3882
}
3883
3883
3884
- public function addMandatoryColumns (ReflectedTable $ table , ReflectedDatabase $ tables , array &$ params )/*: void*/
3884
+ public function addMandatoryColumns (ReflectedTable $ table , ReflectedDatabase $ tables , array &$ params ) /*: void*/
3885
3885
{
3886
- if (!isset ($ params ['join ' ]) || !isset ($ params ['columns ' ])) {
3886
+ if (!isset ($ params ['join ' ]) || !isset ($ params ['include ' ])) {
3887
3887
return ;
3888
3888
}
3889
3889
$ params ['mandatory ' ] = array ();
@@ -3933,7 +3933,7 @@ private function getJoinsAsPathTree(ReflectedDatabase $tables, array $params): P
3933
3933
}
3934
3934
3935
3935
public function addJoins (ReflectedTable $ table , array &$ records , ReflectedDatabase $ tables , array $ params ,
3936
- GenericDB $ db )/*: void*/ {
3936
+ GenericDB $ db ) /*: void*/ {
3937
3937
3938
3938
$ joins = $ this ->getJoinsAsPathTree ($ tables , $ params );
3939
3939
$ this ->addJoinsForTables ($ table , $ joins , $ records , $ tables , $ params , $ db );
@@ -4013,7 +4013,7 @@ private function getFkEmptyValues(ReflectedTable $t1, ReflectedTable $t2, array
4013
4013
return $ fkValues ;
4014
4014
}
4015
4015
4016
- private function addFkRecords (ReflectedTable $ t2 , array $ fkValues , array $ params , GenericDB $ db , array &$ records )/*: void*/
4016
+ private function addFkRecords (ReflectedTable $ t2 , array $ fkValues , array $ params , GenericDB $ db , array &$ records ) /*: void*/
4017
4017
{
4018
4018
$ pk = $ t2 ->getPk ();
4019
4019
$ columnNames = $ this ->columns ->getNames ($ t2 , false , $ params );
@@ -4024,7 +4024,7 @@ private function addFkRecords(ReflectedTable $t2, array $fkValues, array $params
4024
4024
}
4025
4025
}
4026
4026
4027
- private function fillFkValues (ReflectedTable $ t2 , array $ fkRecords , array &$ fkValues )/*: void*/
4027
+ private function fillFkValues (ReflectedTable $ t2 , array $ fkRecords , array &$ fkValues ) /*: void*/
4028
4028
{
4029
4029
$ pkName = $ t2 ->getPk ()->getName ();
4030
4030
foreach ($ fkRecords as $ fkRecord ) {
@@ -4033,7 +4033,7 @@ private function fillFkValues(ReflectedTable $t2, array $fkRecords, array &$fkVa
4033
4033
}
4034
4034
}
4035
4035
4036
- private function setFkValues (ReflectedTable $ t1 , ReflectedTable $ t2 , array &$ records , array $ fkValues )/*: void*/
4036
+ private function setFkValues (ReflectedTable $ t1 , ReflectedTable $ t2 , array &$ records , array $ fkValues ) /*: void*/
4037
4037
{
4038
4038
$ fks = $ t1 ->getFksTo ($ t2 ->getName ());
4039
4039
foreach ($ fks as $ fk ) {
@@ -4058,7 +4058,7 @@ private function getPkEmptyValues(ReflectedTable $t1, array $records): array
4058
4058
return $ pkValues ;
4059
4059
}
4060
4060
4061
- private function addPkRecords (ReflectedTable $ t1 , ReflectedTable $ t2 , array $ pkValues , array $ params , GenericDB $ db , array &$ records )/*: void*/
4061
+ private function addPkRecords (ReflectedTable $ t1 , ReflectedTable $ t2 , array $ pkValues , array $ params , GenericDB $ db , array &$ records ) /*: void*/
4062
4062
{
4063
4063
$ fks = $ t2 ->getFksTo ($ t1 ->getName ());
4064
4064
$ columnNames = $ this ->columns ->getNames ($ t2 , false , $ params );
@@ -4073,7 +4073,7 @@ private function addPkRecords(ReflectedTable $t1, ReflectedTable $t2, array $pkV
4073
4073
}
4074
4074
}
4075
4075
4076
- private function fillPkValues (ReflectedTable $ t1 , ReflectedTable $ t2 , array $ pkRecords , array &$ pkValues )/*: void*/
4076
+ private function fillPkValues (ReflectedTable $ t1 , ReflectedTable $ t2 , array $ pkRecords , array &$ pkValues ) /*: void*/
4077
4077
{
4078
4078
$ fks = $ t2 ->getFksTo ($ t1 ->getName ());
4079
4079
foreach ($ fks as $ fk ) {
@@ -4087,7 +4087,7 @@ private function fillPkValues(ReflectedTable $t1, ReflectedTable $t2, array $pkR
4087
4087
}
4088
4088
}
4089
4089
4090
- private function setPkValues (ReflectedTable $ t1 , ReflectedTable $ t2 , array &$ records , array $ pkValues )/*: void*/
4090
+ private function setPkValues (ReflectedTable $ t1 , ReflectedTable $ t2 , array &$ records , array $ pkValues ) /*: void*/
4091
4091
{
4092
4092
$ pkName = $ t1 ->getPk ()->getName ();
4093
4093
$ t2Name = $ t2 ->getName ();
@@ -4125,7 +4125,7 @@ private function getHabtmEmptyValues(ReflectedTable $t1, ReflectedTable $t2, Ref
4125
4125
return new HabtmValues ($ pkValues , $ fkValues );
4126
4126
}
4127
4127
4128
- private function setHabtmValues (ReflectedTable $ t1 , ReflectedTable $ t3 , array &$ records , HabtmValues $ habtmValues )/*: void*/
4128
+ private function setHabtmValues (ReflectedTable $ t1 , ReflectedTable $ t3 , array &$ records , HabtmValues $ habtmValues ) /*: void*/
4129
4129
{
4130
4130
$ pkName = $ t1 ->getPk ()->getName ();
4131
4131
$ t3Name = $ t3 ->getName ();
0 commit comments