yii\db\Command::queryOne PHP Method

queryOne() public method

This method is best used when only the first row of result is needed for a query.
public queryOne ( integer $fetchMode = null ) : array | false
$fetchMode integer the result fetch mode. Please refer to [PHP manual](http://www.php.net/manual/en/function.PDOStatement-setFetchMode.php) for valid fetch modes. If this parameter is null, the value set in [[fetchMode]] will be used.
return array | false the first row (in terms of an array) of the query result. False is returned if the query results in nothing.
    public function queryOne($fetchMode = null)
    {
        return $this->queryInternal('fetch', $fetchMode);
    }