Passed
Pull Request — master (#19761)
by
unknown
12:56 queued 03:52
created

Query::getUniqueColumns()   B

Complexity

Conditions 9
Paths 8

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 90

Importance

Changes 0
Metric Value
cc 9
eloc 15
nc 8
nop 1
dl 0
loc 24
ccs 0
cts 0
cp 0
crap 90
rs 8.0555
c 0
b 0
f 0
1
<?php
2
/**
3
 * @link https://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license https://www.yiiframework.com/license/
6
 */
7
8
namespace yii\db;
9
10
/**
11
 * Query represents a SELECT SQL statement in a way that is independent of DBMS.
12
 *
13
 * Query provides a set of methods to facilitate the specification of different clauses
14
 * in a SELECT statement. These methods can be chained together.
15
 *
16
 * By calling [[createCommand()]], we can get a [[Command]] instance which can be further
17
 * used to perform/execute the DB query against a database.
18
 *
19
 * For example,
20
 *
21
 * ```php
22
 * $query = new Query;
23
 * // compose the query
24
 * $query->select('id, name')
25
 *     ->from('user')
26
 *     ->limit(10);
27
 * // build and execute the query
28
 * $rows = $query->all();
29
 * // alternatively, you can create DB command and execute it
30
 * $command = $query->createCommand();
31
 * // $command->sql returns the actual SQL
32
 * $rows = $command->queryAll();
33
 * ```
34
 *
35
 * Query internally uses the [[QueryBuilder]] class to generate the SQL statement.
36
 *
37
 * 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).
38
 *
39
 * @property-read string[] $tablesUsedInFrom Table names indexed by aliases.
40
 *
41
 * @author Qiang Xue <[email protected]>
42
 * @since 2.0
43
 */
44
class Query extends BaseQuery
45
{
46
}
47