Commit Graph

76 Commits

Author SHA1 Message Date
Ivan Hermanov
b7d8730044 Fix #16092: Fix duplicate joins in usage of joinWith 2020-03-04 17:57:07 +03:00
Alexander Kartavenko
869f475dc1 Fix #17413, fix #17418: Fixed MSSQL tests 2019-07-10 17:30:41 +03:00
Alexander Kartavenko
9f2a87363e Fixes #17420: Fixed loading of column default values for MSSQL 2019-07-10 17:29:11 +03:00
Alexander Kartavenko
56f639358c Add MSSQL tests (#17410) 2019-07-04 15:51:01 +03:00
Albert Borsos
d2c2f63686 Fixes #17127: yii\db\ActiveRecord::findOne() now accepts table aliases 2019-03-22 15:59:26 +03:00
Dmytro Naumenko
adf8f9a32f Fixes #15931: yii\db\ActiveRecord::findOne() now accepts quoted table and column names using curly and square braces respectively 2019-01-20 17:20:43 +03:00
Pavel Ivanov
4333b90186 Fixes #15482: AR::find()->with() missing data when using string identifiers for relations 2019-01-14 18:50:56 -05:00
Sam
84cb255aab Fixes #16245: Fixed __isset() in BaseActiveRecord not catching errors 2018-05-11 11:04:00 +03:00
Andrey Akimov
2a3428c9e9 Fixes #15875: afterSave for new models flushes unsaved data 2018-04-24 19:40:21 +03:00
Carsten Brandt
0af1c05d6a yii\db\ActiveRecord::findOne() now accepts column names prefixed with table name
fixes #15931
2018-03-21 17:44:22 +01:00
SilverFire - Dmitry Naumenko
b37f361ad7 Fixed possible SQL injection through ActiveRecord::findOne() 2018-03-20 11:20:56 +01:00
Carsten Brandt
52c80f782d moved SQL specific test to SQL AR 2018-03-12 11:21:05 +01:00
SilverFire - Dmitry Naumenko
23b41220ce Fixed ActiveRecordTest::testCustomARRelation() to work on PHP <5.5 2018-02-21 22:22:06 +02:00
Elvira Sheina
ef9600234e Fix magic getter for ActiveRecord (#15696) 2018-02-20 20:10:44 +05:00
SilverFire - Dmitry Naumenko
7bd694dccb Enhanced tests 2018-02-16 00:06:59 +02:00
SilverFire - Dmitry Naumenko
c3c9d1fd97 Merge branch 'master' into SamMousa-indexby-after-relations-9342
Conflicts:
	framework/db/Query.php
2018-02-15 23:38:06 +02:00
Nikolay Oleynikov
74dc1cdc30 Fixes #13618: Active record now resets related models after corresponding attributes updates
Co-authored-by: Robert Korulczyk <robert@korulczyk.pl>
2018-02-12 02:26:49 +03:00
Zhukov Roman
40b038379f Fixes #13019: Support JSON in SchemaBuilderTrait 2018-02-06 16:35:49 +03:00
Vladimir Reznichenko
67f67e3a69 SCA with Php Inspections (EA Extended) (#15571) 2018-01-29 17:08:57 +07:00
Klimov Paul
71c541773f PHPDoc fix 2018-01-23 13:17:25 +02:00
Klimov Paul
65f6b59b35 @inheritdoc notation changed 2018-01-23 13:11:24 +02:00
Klimov Paul
b9cbc56330 Fixed yii\db\ActiveRecord::with() unable to use relation defined via attached behavior in case asArray is enabled 2018-01-23 12:46:56 +02:00
Alexander Makarov
fb23b0d0ea Code style fixes 2017-11-01 02:43:02 +03:00
Alexander Makarov
afd59a18ec Merge branch 'master' into indexby-after-relations-9342 2017-10-08 00:52:14 +02:00
Paul Klimov
d68789a195 Fixes #13779, fixes #5786
- #13779: Fixed `yii\db\ActiveRecord::joinWith()` unable to use relation defined via attached behavior.
- #5786: Allowed to use custom constructors in ActiveRecord-based classes.
2017-08-29 15:13:28 +03:00
Robert Korulczyk
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
Robert Korulczyk
0c0942d6e2 Enable phpdoc_add_missing_param_annotation rule in php-cs-fixer config. (#14681) [skip ci] 2017-08-21 01:57:23 +03:00
Robert Korulczyk
b99e955627 Fix CS (#14665)
* Run php-cs-fixer.

* Enable phpdoc_types rule.
2017-08-18 12:10:42 +02:00
Carsten Brandt
c9347b0a57 Fixed ambiguous column error on indexBy with JOIN
fixes #13859
close #14431
2017-07-12 12:26:30 +02:00
Carsten Brandt
173108b5b0 Move getTablesUsedInFrom() from ActiveQuery to Query
enable this feature on the Query level

close #14431
2017-07-12 12:26:20 +02:00
Carsten Brandt
0559a95db9 Fixed ambiguous column error in BaseActiveRecord::refresh()
when the query adds a JOIN by default

fixes #13757
2017-07-11 11:47:35 +02:00
Robert Korulczyk
d2781cd232 Added configuration for headers in PHP files generated by message/extract command (#14417) 2017-07-10 20:14:54 +03:00
Carsten Brandt
f212bc6caf ensure tablenames are not replaced in insert and update 2017-06-16 16:02:34 +02:00
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.
2017-06-12 12:25:45 +03:00
Robert Korulczyk
31e321b9b2 Remove unused imports. (#14096) 2017-05-01 20:26:15 +02:00
Klimov Paul
d8e6a89af9 fixed tests without assettions 2017-04-13 16:17:35 +03:00
Klimov Paul
dee88787fc compatibility with PHPUnit 6.x added 2017-04-13 14:49:43 +03:00
Sam Mousa
5675ed818d Fixed tests 2017-04-05 10:12:16 +02:00
Sam Mousa
7ab2a1efa8 Fixed test 2017-04-03 13:06:18 +02:00
Sam Mousa
e0e07c9c1b Added test for indexing by related fields. 2017-04-03 10:41:48 +02:00
usix298
13c2f5370f Fixed formatting in tests [skip ci] 2017-03-18 00:13:08 +03:00
Alexander Makarov
3f8e8a89eb Used more specific unit test assertions in framework tests 2017-03-14 09:45:31 +03:00
gagatust
6397791513 Fixed whitespaces to match code style [skip ci] 2017-03-14 09:42:13 +03:00
Nikolay Oleynikov
323568c2e9 Remove trailing spaces from sources and tests (#13621) [skip ci] 2017-02-19 17:34:22 +03:00
SilverFire - Dmitry Naumenko
88f2348ed5 Fixed ActiveRecord::unlinkAll() to respect onCondition()
Closes #12213
2016-12-14 22:51:21 +02:00
Klimov Paul
50b668eee8 redundant code removed 2016-12-13 16:54:51 +02:00
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
2016-12-02 13:28:51 +01:00
p.chapl
3e1588b5b9 Added unit tests for #9561
canGetProperty and canSetProperty on ActiveRecord checks attributes

close #11087
2016-10-13 13:18:37 +02:00
SilverFire - Dmitry Naumenko
8eaf4e2ffe #12544 - Added mote test cases for AssetBundleTest::testRegisterFileAppendTimestamp() 2016-09-15 19:51:17 +03:00
Klimov Paul
ea03f56d42 BaseActiveRecord methods canGetProperty() and canSetProperty() improved to handle attribute list fetching failure. 2016-09-05 12:22:09 +03:00