Represents a type of association that that can be fetched using another query
Appends any conditions required to load the relevant set of records in the target table query given a filter key and some filtering values.
Appends any conditions required to load the relevant set of records in the target table query given a filter key and some filtering values when the filtering needs to be done using a subquery.
Checks that the fetching query either has auto fields on or has the foreignKey fields selected. If the required fields are missing, throws an exception.
Auxiliary function to construct a new Query object to return all the records in the target table that are associated to those specified in $options from the source table
Builds an array containing the results from fetchQuery indexed by the foreignKey value corresponding to this association.
Builds a query to be used as a condition for filtering records in the target table, it is constructed by cloning the original query that was used to load records in the source table.
Returns a TupleComparison object that can be used for matching all the fields from $keys with the tuple values in $filter using the provided operator.
Generates a string used as a table field that contains the values upon which the filter should be applied
Returns a callable to be used for each row in a query result set for injecting the eager loaded rows when the matching needs to be done with multiple foreign keys
Returns a callable to be used for each row in a query result set for injecting the eager loaded rows
Returns true if the eager loading process will require a set of the owning table's binding keys in order to use them as a filter in the finder query.
_addFilteringCondition( Cake\ORM\Query $query , string|array $key , mixed $filter )
Appends any conditions required to load the relevant set of records in the target table query given a filter key and some filtering values.
Cake\ORM\Query
$query
$key
$filter
Cake\ORM\Query
_addFilteringJoin( Cake\ORM\Query $query , string $key , Cake\ORM\Query $subquery )
Appends any conditions required to load the relevant set of records in the target table query given a filter key and some filtering values when the filtering needs to be done using a subquery.
Cake\ORM\Query
$query
$key
Cake\ORM\Query
$subquery
Cake\ORM\Query
_assertFieldsPresent( Cake\ORM\Query $fetchQuery , array $key )
Checks that the fetching query either has auto fields on or has the foreignKey fields selected. If the required fields are missing, throws an exception.
Cake\ORM\Query
$fetchQuery
$key
_buildQuery( array $options )
Auxiliary function to construct a new Query object to return all the records in the target table that are associated to those specified in $options from the source table
$options
Cake\ORM\Query
_buildResultMap( Cake\ORM\Query $fetchQuery , array $options )
Builds an array containing the results from fetchQuery indexed by the foreignKey value corresponding to this association.
Cake\ORM\Query
$fetchQuery
$options
_buildSubquery( Cake\ORM\Query $query )
Builds a query to be used as a condition for filtering records in the target table, it is constructed by cloning the original query that was used to load records in the source table.
Cake\ORM\Query
$query
Cake\ORM\Query
_createTupleCondition( Cake\ORM\Query $query , array $keys , mixed $filter , string $operator )
Returns a TupleComparison object that can be used for matching all the fields from $keys with the tuple values in $filter using the provided operator.
Cake\ORM\Query
$query
$keys
$filter
$operator
_defaultOptions( )
Returns the default options to use for the eagerLoader
_linkField( array $options )
Generates a string used as a table field that contains the values upon which the filter should be applied
$options
_multiKeysInjector( array $resultMap , array $sourceKeys , string $nestKey )
Returns a callable to be used for each row in a query result set for injecting the eager loaded rows when the matching needs to be done with multiple foreign keys
$resultMap
$sourceKeys
$nestKey
_resultInjector( Cake\ORM\Query $fetchQuery , array $resultMap , array $options )
Returns a callable to be used for each row in a query result set for injecting the eager loaded rows
Cake\ORM\Query
$fetchQuery
$resultMap
an array with the foreignKey as keys and the corresponding target table results as value.
$options
_subqueryFields( Cake\ORM\Query $query )
Calculate the fields that need to participate in a subquery.
Normally this includes the binding key columns. If there is a an ORDER BY, those columns are also included as the fields may be calculated or constant values, that need to be present to ensure the correct association data is loaded.
Cake\ORM\Query
$query
eagerLoader( array $options )
requiresKeys( array $options [] )
Returns true if the eager loading process will require a set of the owning table's binding keys in order to use them as a filter in the finder query.
$options
optional []
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.3/class-Cake.ORM.Association.SelectableAssociationTrait.html