Carsten Brandt
c9347b0a57
Fixed ambiguous column error on indexBy with JOIN
...
fixes #13859
close #14431
7 years ago
Carsten Brandt
173108b5b0
Move getTablesUsedInFrom() from ActiveQuery to Query
...
enable this feature on the Query level
close #14431
7 years ago
Robert Korulczyk
fe8a0a6a2e
Enable `no_useless_else` rule in php-cs-fixer ( #14420 )
7 years ago
Carsten Brandt
53f380ca46
improved docs of Query::from()
...
fixes #14407
7 years ago
Robert Korulczyk
ba0ab403b5
Added php-cs-fixer coding standards validation to Travis CI ( #14100 )
...
* php-cs-fixer: PSR2 rule.
* php-cs-fixer: PSR2 rule - fix views.
* Travis setup refactoring.
* Add php-cs-fixer to travis cs tests.
* Fix tests on hhvm-3.12
* improve travis config
* composer update
* revert composer update
* improve travis config
* Fix CS.
* Extract config to separate classes.
* Extract config to separate classes.
* Add file header.
* Force short array syntax.
* binary_operator_spaces fixer
* Fix broken tests
* cast_spaces fixer
* concat_space fixer
* dir_constant fixer
* ereg_to_preg fixer
* function_typehint_space fixer
* hash_to_slash_comment fixer
* is_null fixer
* linebreak_after_opening_tag fixer
* lowercase_cast fixer
* magic_constant_casing fixer
* modernize_types_casting fixer
* native_function_casing fixer
* new_with_braces fixer
* no_alias_functions fixer
* no_blank_lines_after_class_opening fixer
* no_blank_lines_after_phpdoc fixer
* no_empty_comment fixer
* no_empty_phpdoc fixer
* no_empty_statement fixer
* no_extra_consecutive_blank_lines fixer
* no_leading_import_slash fixer
* no_leading_namespace_whitespace fixer
* no_mixed_echo_print fixer
* no_multiline_whitespace_around_double_arrow fixer
* no_multiline_whitespace_before_semicolons fixer
* no_php4_constructor fixer
* no_short_bool_cast fixer
* no_singleline_whitespace_before_semicolons fixer
* no_spaces_around_offset fixer
* no_trailing_comma_in_list_call fixer
* no_trailing_comma_in_singleline_array fixer
* no_unneeded_control_parentheses fixer
* no_unused_imports fixer
* no_useless_return fixer
* no_whitespace_before_comma_in_array fixer
* no_whitespace_in_blank_line fixer
* not_operator_with_successor_space fixer
* object_operator_without_whitespace fixer
* ordered_imports fixer
* php_unit_construct fixer
* php_unit_dedicate_assert fixer
* php_unit_fqcn_annotation fixer
* phpdoc_indent fixer
* phpdoc_no_access fixer
* phpdoc_no_empty_return fixer
* phpdoc_no_package fixer
* phpdoc_no_useless_inheritdoc fixer
* Fix broken tests
* phpdoc_return_self_reference fixer
* phpdoc_single_line_var_spacing fixer
* phpdoc_single_line_var_spacing fixer
* phpdoc_to_comment fixer
* phpdoc_trim fixer
* phpdoc_var_without_name fixer
* psr4 fixer
* self_accessor fixer
* short_scalar_cast fixer
* single_blank_line_before_namespace fixer
* single_quote fixer
* standardize_not_equals fixer
* ternary_operator_spaces fixer
* trailing_comma_in_multiline_array fixer
* trim_array_spaces fixer
* protected_to_private fixer
* unary_operator_spaces fixer
* whitespace_after_comma_in_array fixer
* `parent::setRules()` -> `$this->setRules()`
* blank_line_after_opening_tag fixer
* Update finder config.
* Revert changes for YiiRequirementChecker.
* Fix array formatting.
* Add missing import.
* Fix CS for new code merged from master.
* Fix some indentation issues.
7 years ago
Alex-Code
7c6620a65f
Fixes #13846 : Fixed `Query::count()` issue with `orderBy`
7 years ago
Alex-Code
13de76714b
Refactored `yii\db\Query::queryScalar()` method
8 years ago
Pavel Chaplygin
25e6eb04a5
refs #11122 : Fixed can not use `orderBy` with aggregate functions ( #12772 )
...
* refs #11122 : Fixed can not use `orderBy` with aggregate functions like `count`, `max` etc.
* Update QueryTest.php
8 years ago
Brandon Kelly
350e93e626
Fixes #12612 : Query conditions added with `yii\db\Query::andWhere()` now get appended to the existing conditions if they were already being joined with the `and` operator
8 years ago
Dmitry Naumenko
518be6b8ec
Enhanced PHPDocs markup
8 years ago
Alexander Makarov
837b33767c
Fixes #11697 : Added `filterHaving()`, `andFilterHaving()` and `orFilterHaving()` to `yii\db\Query`
...
Signed-off-by: Alexander Makarov <sam@rmcreative.ru>
8 years ago
Konstantin Tsukur
e78a7fe20e
Initial work on #11697
8 years ago
Klimov Paul
c17766181f
Added `QueryInterface::emulateExecution()`
...
Added `QueryInterface::emulateExecution()`, which allows preventing of
the actual query execution.
This allows to cancel `DataProvider` preventing search query execution
in case search model is invalid:
``` php
public function search($params)
{
$query = Item::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
$query->where('0=1');
$query->emulateExecution(); // No SQL execution will be done
return $dataProvider;
}
```
This also fix unecessary query in case of `via()` usage. See #12390 .
fixes #12390
fixes #6373
close #12708
8 years ago
Robert Korulczyk
4aa935e69e
Fixes #12055 : Changed `boolean` to `bool` and `integer` to `int` in phpdoc
8 years ago
Alexander Makarov
677b55475b
Reverted accidental commit
8 years ago
Konstantin Tsukur
2ffa670885
add functions for filtering
8 years ago
Robert Korulczyk
e7195da4b3
Fix `yii\db\Query::having` phpdoc [skip ci]
8 years ago
SilverFire - Dmitry Naumenko
95152f3c2c
Fixed consistency of `indexBy` handling for `yii\db\Query::column()`
...
Closes #12649
8 years ago
Nate Sanden
d33227ab85
typo fix ( #12217 ) [skip ci]
8 years ago
Alexander Makarov
0061692e60
Replaced unnecessary double quotes with single quotes
8 years ago
Carsten Brandt
e4dc2026bc
note about JOIN syntax
...
fixes #7549
8 years ago
Evgeniy Tkachenko
dbb54f986c
Updated phpDoc of scalar
8 years ago
Carsten Brandt
4411a74ebd
proper fix for #9425 , adjust changes from #11363
...
includes tests and fix that works in all cases.
9 years ago
Lennart van den Dool
f8a844a90f
Query helper method for filter values containing operators
...
Basic implementation proposal for yiisoft/yii2#2022
Shortcomings/todo's:
* filtering on non-scalars (where IN statements) not supported
* Numeric properties with a corresponding validation rule will yield
errors when they contain an alphanumeric operator. These properties'
rules should be defined as 'string' or 'safe'.
* no implementation example in Gii code (yet).
close #8505
9 years ago
PowerGamer1
73eb62a3cd
DBMS specific workarounds for unsupported SQL92 form of `SELECT EXISTS()` ( #11369 )
9 years ago
PowerGamer1
806eb57990
Fixes #9425 : ActiveQuery::exists() should generate SELECT EXISTS() ( #11363 )
9 years ago
Carsten Brandt
191f2a4943
fixed phpdoc type names
9 years ago
Carsten Brandt
ce35739469
joinWith implementation cleanup
9 years ago
Carsten Brandt
3f8df39f45
more tests for joinWith alias
...
also test on joining the same relation twice
9 years ago
Carsten Brandt
e43c41c9ea
db layer phpdoc fixes
9 years ago
Carsten Brandt
5a462dc5d2
added tests and documentation for #8824
9 years ago
Carsten Brandt
468886a77b
small refactoring for #9452
9 years ago
SilverFire - Dmitry Naumenko
cd87d67f34
Global DOCS update: ~~~ replaced with ```
9 years ago
Carsten Brandt
7c7ed48c4c
cleanup docs and duplicate code in query
9 years ago
Carsten Brandt
decd45201c
allow passing a single Expression object to select() and addSelect()
...
fixes #9883
9 years ago
Carsten Brandt
4e7adc13ea
adjusted docs about Query::from() and subqueries
...
also added a test to verify behavior
close #9720
close #9266
9 years ago
Aleksandr Golovko
a2f70f6484
Update Query doc return type
...
When used ActiveQuery chain call after call any of join type IDE cannot resolve ActiveQuery methods such an asArray
Example:
SomeActiveRecordModel::find()
->select('...') // return ActiveQuery
->leftJoin('...', '...') // return Query
->asArray() // it's become undefined
->column();
9 years ago
Alexander Mohorev
68c30c1034
Replace aliases of functions
9 years ago
Alexander Mohorev
ae42a054bb
PSR-2 spaces, commas, etc
9 years ago
Carsten Brandt
f68e970de2
link to PHP classes just as we do with normal classes
...
apidoc can handle this!
9 years ago
Alexander Makarov
67658cf57d
Replaced static with $this in phpdoc since current IDEs are finally able to handle it correctly
9 years ago
Carsten Brandt
1cfc40d6e5
link to the guide on quoting from query phpdoc
...
fixes #8141
10 years ago
Carsten Brandt
f99f333218
added note to docs about #8085
10 years ago
Klimov Paul
b8081b59b3
Fixed `yii\db\Query::count()` fails for query containing 'having' without 'group by'
10 years ago
Qiang Xue
aead65f2d2
Fixes #7515 : Added support to use `indexBy()` together with `column()` in query builder
10 years ago
Carsten Brandt
4267b53d43
added doc about count() return value
...
fixes #yiisoft/yii#3712
10 years ago
Paul Klimov
5ad6ba5c9e
Fix from e719ff5
moved to `yii\sphinx\Query`
10 years ago
Paul Klimov
e719ff5854
`yii\db\Query::queryScalar()` fixed to use `static` when creating subquery
10 years ago
Qiang Xue
2544e86d2c
Fixes #5735 : Added `yii\bootstrap\Tabs::renderTabContent` to support manually rendering tab contents
10 years ago
Serge Postrash
5acf17e658
Fixed phpdoc for yii\db\Query [skip ci]
10 years ago