1 | <?php |
||
22 | class Command extends Component |
||
23 | { |
||
24 | /** |
||
25 | * @var Connection |
||
26 | */ |
||
27 | public $db; |
||
28 | |||
29 | /** |
||
30 | 2 | * @var Request request object |
|
31 | */ |
||
32 | 2 | protected $request; |
|
33 | |||
34 | 2 | /** |
|
35 | * @var int the default number of seconds that query results can remain valid in cache. |
||
36 | * Use 0 to indicate that the cached data will never expire. And use a negative number to indicate |
||
37 | * query cache should not be used. |
||
38 | * @see cache() |
||
39 | */ |
||
40 | public $queryCacheDuration; |
||
41 | |||
42 | /** |
||
43 | * @var Dependency the dependency to be associated with the cached query result for this command |
||
44 | 2 | * @see cache() |
|
45 | */ |
||
46 | 2 | public $queryCacheDependency; |
|
47 | |||
48 | 2 | public function getRequest() |
|
52 | |||
53 | public function setRequest(Request $request) |
||
59 | |||
60 | public function queryInternal($default = null) |
||
98 | |||
99 | public function queryOne() |
||
103 | |||
104 | public function queryAll() |
||
108 | |||
109 | public function count() |
||
113 | |||
114 | /** |
||
115 | 2 | * Enables query cache for this command. |
|
116 | * @param int $duration the number of seconds that query result of this command can remain valid in the cache. |
||
117 | 2 | * If this is not set, the value of [[Connection::queryCacheDuration]] will be used instead. |
|
118 | 2 | * Use 0 to indicate that the cached data will never expire. |
|
119 | 2 | * @param Dependency $dependency the cache dependency associated with the cached query result |
|
120 | 2 | * @return $this the command object itself |
|
121 | 2 | */ |
|
122 | 2 | public function cache($duration = null, $dependency = null) |
|
128 | |||
129 | 2 | /** |
|
130 | * Disables query cache for this command. |
||
131 | * @return $this the command object itself |
||
132 | */ |
||
133 | public function noCache() |
||
138 | } |
||
139 |