Property | Type | Description | |
---|---|---|---|
$_autoFields | boolean | Tracks whether or not the original query should include fields from the top level table. | |
$_beforeFindFired | boolean | True if the beforeFind event has already been triggered for this query | |
$_counter | callable | A callable function that can be used to calculate the total amount of records this query will match when not using limit | |
$_eagerLoader | Cake\ORM\EagerLoader | Instance of a class responsible for storing association containments and for eager loading them when this query is executed | |
$_hasFields | boolean | Whether the user select any fields before being executed, this is used to determined if any fields should be automatically be selected. | |
$_hydrate | boolean | Whether to hydrate results into entity objects | |
$_resultsCount | integer | When set, count query execution will be bypassed. |
Method | Description | |
---|---|---|
__call ( $method, $arguments ) | {@inheritDoc} | |
__clone ( ) : void | Object clone hook. | |
__construct ( Cake\Datasource\ConnectionInterface $connection, |
Constructor | |
__debugInfo ( ) | {@inheritDoc} | |
addDefaultTypes ( |
Hints this object to associate the correct types when casting conditions for the database. This is done by extracting the field types from the schema associated to the passed table object. This prevents the user from repeating himself when specifying conditions. | |
all ( ) | {@inheritDoc} | |
applyOptions ( array $options ) | {@inheritDoc} | |
autoFields ( boolean | null $value = null ) : boolean | $this | Get/Set whether or not the ORM should automatically append fields. | |
cache ( $key, $config = 'default' ) | {@inheritDoc} | |
cleanCopy ( ) : |
Creates a copy of this current query, triggers beforeFind and resets some state. | |
contain ( array | string | null $associations = null, boolean $override = false ) : array | $this | Sets the list of associations that should be eagerly loaded along with this query. The list of associated tables passed must have been previously set as associations using the Table API. | |
count ( ) | {@inheritDoc} | |
counter ( callable | null $counter ) | Registers a callable function that will be executed when the count method in this query is called. The return value for the function will be set as the return value of the count method. | |
delete ( string | null $table = null ) | Create a delete query. | |
eagerLoader ( Cake\ORM\EagerLoader $instance = null ) : Cake\ORM\EagerLoader | $this | Sets the instance of the eager loader class to use for loading associations and storing containments. If called with no arguments, it will return the currently configured instance. | |
find ( $finder, array $options = [] ) | {@inheritDoc} | |
hydrate ( boolean | null $enable = null ) : boolean | $this | Toggle hydrating entities. | |
innerJoinWith ( string $assoc, callable $builder = null ) | Creates an INNER JOIN with the passed association table while preserving the foreign key matching and the custom conditions that were originally set for it. | |
insert ( array $columns, array $types = [] ) | Create an insert query. | |
jsonSerialize ( ) : Cake\Datasource\ResultSetInterface | Executes the query and converts the result set into JSON. | |
leftJoinWith ( string $assoc, callable $builder = null ) | Creates a LEFT JOIN with the passed association table while preserving the foreign key matching and the custom conditions that were originally set for it. | |
matching ( string $assoc, callable $builder = null ) | Adds filtering conditions to this query to only bring rows that have a relation to another from an associated table, based on conditions in the associated table. | |
notMatching ( string $assoc, callable $builder = null ) | Adds filtering conditions to this query to only bring rows that have no match to another from an associated table, based on conditions in the associated table. | |
select ( array | Cake\Database\ExpressionInterface | string | |
{@inheritDoc} | |
sql ( |
{@inheritDoc} | |
triggerBeforeFind ( ) : void | Trigger the beforeFind event on the query's repository object. | |
update ( string | null $table = null ) | Create an update query. |
Method | Description | |
---|---|---|
_addAssociationsToTypeMap ( |
Used to recursively add contained association column types to the query. | |
_addDefaultFields ( ) : void | Inspects if there are any set fields for selecting, otherwise adds all the fields for the default table. | |
_addDefaultSelectTypes ( ) : void | Sets the default types for converting the fields in the select clause | |
_decorateResults ( Traversable $result ) : Cake\Datasource\ResultSetInterface | Decorates the results iterator with MapReduce routines and formatters | |
_dirty ( ) : void | Marks a query as dirty, removing any preprocessed information from in memory caching such as previous results | |
_execute ( ) : Cake\ORM\ResultSet | Executes this query and returns a ResultSet object containing the results. | |
_performCount ( ) : integer | Performs and returns the COUNT(*) for the query. | |
_transformQuery ( ) : void | Applies some defaults to the query object before it is executed. |
Method | Description | |
---|---|---|
_all ( ) | ||
_applyDecorators ( ) | ||
_cache ( ) | ||
_call ( ) |
public __construct ( Cake\Datasource\ConnectionInterface $connection, |
||
$connection | Cake\Datasource\ConnectionInterface | The connection object |
$table | The table this query is starting on |
protected _addAssociationsToTypeMap ( |
||
$table | The table instance to pluck associations from. | |
$typeMap | Cake\Database\TypeMap | The typemap to check for columns in. This typemap is indirectly mutated via Cake\ORM\Query::addDefaultTypes() |
$associations | array | The nested tree of associations to walk. |
return | void |
protected _addDefaultFields ( ) : void | ||
return | void |
protected _addDefaultSelectTypes ( ) : void | ||
return | void |
protected _decorateResults ( Traversable $result ) : Cake\Datasource\ResultSetInterface | ||
$result | Traversable | Original results |
return | Cake\Datasource\ResultSetInterface |
protected _execute ( ) : Cake\ORM\ResultSet | ||
return | Cake\ORM\ResultSet |
protected _performCount ( ) : integer | ||
return | integer |
protected _transformQuery ( ) : void | ||
return | void |
public addDefaultTypes ( |
||
$table | The table to pull types from |
public applyOptions ( array $options ) | ||
$options | array |
public cleanCopy ( ) : |
||
return |
public contain ( array | string | null $associations = null, boolean $override = false ) : array | $this | ||
$associations | array | string | null | List of table aliases to be queried. |
$override | boolean | Whether override previous list with the one passed defaults to merging previous list with the new one. |
return | array | $this |
public count ( ) |
public eagerLoader ( Cake\ORM\EagerLoader $instance = null ) : Cake\ORM\EagerLoader | $this | ||
$instance | Cake\ORM\EagerLoader | The eager loader to use. Pass null to get the current eagerloader. |
return | Cake\ORM\EagerLoader | $this |
public innerJoinWith ( string $assoc, callable $builder = null ) | ||
$assoc | string | The association to join with |
$builder | callable | a function that will receive a pre-made query object that can be used to add custom conditions or selecting some fields |
public jsonSerialize ( ) : Cake\Datasource\ResultSetInterface | ||
return | Cake\Datasource\ResultSetInterface | The data to convert to JSON. |
public leftJoinWith ( string $assoc, callable $builder = null ) | ||
$assoc | string | The association to join with |
$builder | callable | a function that will receive a pre-made query object that can be used to add custom conditions or selecting some fields |
public notMatching ( string $assoc, callable $builder = null ) | ||
$assoc | string | The association to filter by |
$builder | callable | a function that will receive a pre-made query object that can be used to add custom conditions or selecting some fields |
public select ( array | Cake\Database\ExpressionInterface | string | |
||
$fields | array | Cake\Database\ExpressionInterface | string | |
fields to be added to the list. |
$overwrite | boolean | whether to reset fields with passed list or not |
public sql ( |
||
$binder |
public triggerBeforeFind ( ) : void | ||
return | void |
protected bool $_autoFields | ||
return | boolean |
protected bool $_beforeFindFired | ||
return | boolean |
protected callable $_counter | ||
return | callable |
protected EagerLoader,Cake\ORM $_eagerLoader | ||
return | Cake\ORM\EagerLoader |
protected bool $_hasFields | ||
return | boolean |
protected bool $_hydrate | ||
return | boolean |
protected int $_resultsCount | ||
return | integer |