for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\db;
* Query represents a SELECT SQL statement in a way that is independent of DBMS.
*
* Query provides a set of methods to facilitate the specification of different clauses
* in a SELECT statement. These methods can be chained together.
* By calling [[createCommand()]], we can get a [[Command]] instance which can be further
* used to perform/execute the DB query against a database.
* For example,
* ```php
* $query = new Query;
* // compose the query
* $query->select('id, name')
* ->from('user')
* ->limit(10);
* // build and execute the query
* $rows = $query->all();
* // alternatively, you can create DB command and execute it
* $command = $query->createCommand();
* // $command->sql returns the actual SQL
* $rows = $command->queryAll();
* ```
* Query internally uses the [[QueryBuilder]] class to generate the SQL statement.
* A more detailed usage guide on how to work with Query can be found in the [guide article on Query Builder](guide:db-query-builder).
* @property-read string[] $tablesUsedInFrom Table names indexed by aliases.
* @author Qiang Xue <[email protected]>
* @since 2.0
class Query extends BaseQuery
{
}