mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Add int return type queryScalar and scalar method docs
This commit is contained in:
@ -424,7 +424,7 @@ class Command extends Component
|
||||
/**
|
||||
* Executes the SQL statement and returns the value of the first column in the first row of data.
|
||||
* This method is best used when only a single value is needed for a query.
|
||||
* @return string|null|false the value of the first column in the first row of the query result.
|
||||
* @return string|int|null|false the value of the first column in the first row of the query result.
|
||||
* False is returned if there is no value.
|
||||
* @throws Exception execution failed
|
||||
*/
|
||||
|
@ -290,7 +290,7 @@ class Query extends Component implements QueryInterface, ExpressionInterface
|
||||
* The value returned will be the first column in the first row of the query results.
|
||||
* @param Connection $db the database connection used to generate the SQL statement.
|
||||
* If this parameter is not given, the `db` application component will be used.
|
||||
* @return string|null|false the value of the first column in the first row of the query result.
|
||||
* @return string|int|null|false the value of the first column in the first row of the query result.
|
||||
* False is returned if the query result is empty.
|
||||
*/
|
||||
public function scalar($db = null)
|
||||
|
Reference in New Issue
Block a user