Represents a type of association that that needs to be recovered by performing an extra query.
_buildResultMap( mixed $fetchQuery , mixed $options )
_defaultOptions( )
Returns the default options to use for the eagerLoader
array
_options( array $opts )
Parse extra options passed in the constructor.
$opts
canBeJoined( array $options [] )
Whether this association can be expressed directly in a query join
$options
optional [] boolean
defaultRowValue( mixed $row , mixed $joined )
foreignKey( string|null $key null )
Sets the name of the field representing the foreign key to the source table. If no parameters are passed current field is returned
$key
optional null string
sort( mixed $sort null )
Sets the sort order in which target records should be returned. If no arguments are passed the currently configured value is returned
$sort
optional null mixed
_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
_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
InvalidArgumentException
_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
Cake\Database\Expression\TupleComparison
_linkField( array $options )
Generates a string used as a table field that contains the values upon which the filter should be applied
$options
string|array
_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
Closure
_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
$options
Closure
_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
array
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 [] boolean
© 2005–2016 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.
http://api.cakephp.org/3.1/class-Cake.ORM.Association.ExternalAssociationTrait.html