50 Commits

Author SHA1 Message Date
e6f5c46cdc Fixes #15633: Deprecate some things going away/changing in 2.1
- Deprecated `yii\base\BaseObject::className()` in favor of native PHP syntax `::class`, which does not trigger autoloading
- Deprecated XCache and Zend data cache support as caching backends
- Deprecated `yii\BaseYii::powered()` method
- Added `yii\base\InvalidArgumentException` and deprecated `yii\base\InvalidParamException`
- Added `yii\BaseYii::debug()` and deprecated `yii\BaseYii::trace()`
2018-02-11 01:48:29 +03:00
1e0157f0ac Fixes #7316: Documentation for ActiveRelationTrait::inverseOf() [skip ci] (#14892) 2017-10-07 18:59:53 +02:00
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
8ff3756d55 remove loop over an array with one element
small optimization, fixes #12061
2017-08-22 13:03:01 +02:00
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
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
fe8a0a6a2e Enable no_useless_else rule in php-cs-fixer (#14420) 2017-07-10 11:26:21 +03:00
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
c19b2f7dc8 release version 2.0.11 2017-02-01 17:46:29 +01:00
5609e918de Fixed some malformed @var tags (#13468) [skip ci] 2017-01-30 11:42:52 +03:00
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
3a6fbad561 phpDoc: Fix example for ActiveRelationTrait::via() (#13008) [skip ci] 2016-11-15 13:30:04 +03:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
217d50e4ff improved PHPdoc and @since annotations 2016-07-11 12:58:43 +02:00
0f640c7138 Make sure inverseOf relations are also populated during dynamic relational queries
Refs #6347
2016-07-04 15:07:37 +02:00
52e23e0317 fix issue with composite key in combination with join
fixes #10201
fixes #9047
close #9895
2016-04-22 16:39:06 +02:00
762b9207ea Avoid some calls to new $this->modelClass in ActiveQuery
this fixes some cases of the problem described in #8639 and is fully BC.
Fixing other places may need BC breaks.
2016-02-23 13:24:01 +01:00
1b3770fd21 Use === instead of == where possible 2015-10-10 01:04:35 +03:00
67658cf57d Replaced static with $this in phpdoc since current IDEs are finally able to handle it correctly 2015-05-31 13:39:30 +03:00
582b7606ac Fixed yii\db\ActiveRelationTrait::populateRelation() fails when link refers to array string convertable object attribute 2015-05-08 11:17:35 +03:00
4503cae876 code style fix 2015-04-24 13:47:44 +03:00
c0fc4596e2 Fixed yii\db\ActiveRelationTrait::populateRelation() fails when link refers to string convertable object attribute, like \MongoId 2015-04-24 13:42:47 +03:00
6481d13494 Optimized checks order in conditions 2015-02-08 17:56:36 +03:00
02622b6fe4 phpdoc fixes and additions 2014-10-14 01:35:21 +04:00
15c8935db1 Fixed yii\mongodb\ActiveRecord unable to fetch 'hasMany' referred by array of \MongoId 2014-10-09 14:55:43 +03:00
cba52e3c5e Fixes #5382: renamed "pivot table" to "junction table" since it's correct term to use 2014-10-07 01:13:17 +04:00
222f9ddfad added missing documentation about the NOT operator in Query
fixes #5147
2014-09-24 12:53:33 +02:00
aa8c013ebf Fixes #3197: Using ActiveQuery::indexBy() may cause relational AR queries to generate incorrect relational results 2014-09-23 10:29:11 -04:00
f5f9364785 fixed test break
how did that manage to pass before...?
2014-07-23 02:50:18 +02:00
d036d2f5bf add support for array valued attr relations to unlink and link 2014-07-23 01:25:33 +02:00
cc38e9c795 fixed issue with indexBy and array valued relations 2014-07-21 00:35:55 +02:00
1a07485e27 Added support for relation by array attributes
fixes #1249
2014-07-20 23:33:51 +02:00
593b478f2b Added extra callable typehints 2014-07-10 19:12:05 +04:00
1b4a9b62cd Fixes #3568: When the primary query sets asArray, it is not respected by the via relational query 2014-06-25 23:35:02 -04:00
0c14f47f9a Fixes #3793: Changed inline autocomplete hints style to get more IDEs support 2014-06-20 17:40:00 +04:00
2b593da08f phpdoc issue
[ci skip]
2014-04-22 20:14:49 +02:00
76d8e2b5b3 code style, fixes #3140 2014-04-17 13:24:16 +02:00
c1445871f4 Correction of many errors code inspection.
Adjustments code according to the standards.
Adding missing PHPDoc comment.
2014-04-16 19:29:07 -03:00
544243d517 Update ActiveRelationTrait.php 2014-04-15 01:33:42 -03:00
0b29c9607d fixed broken API links [skip ci] 2014-04-09 22:22:49 -04:00
78136d4278 Fixes #2880: filterByModels() should prefix key columns in a join query. 2014-03-26 11:19:01 -04:00
bf3c75147d reverted breaking PHPdoc codestyle changes
issue #2852
2014-03-23 20:51:09 +01:00
b5f8a4dc22 Reformat code te be PSR-2 compatible 2014-03-16 10:46:21 +06:00
34cfb356e9 Fixes #2713: using relations defined in behavior may throw exception in lazy loading. 2014-03-12 21:23:29 -04:00
eaaa5b1bb5 fix code style 2014-03-04 06:12:30 +02:00
33d6acba25 Improved behavior support, fixes #2550
call hasMethod() instead of using method_exists
2014-02-26 14:18:24 +01:00
614bffb01a Fixed issue with preventing from clearing events and behaviors on clone 2014-02-24 18:15:19 -08:00
1708a36d95 WIP merge ActiveRelation into ActiveQuery
allow extending only one class to add scopes, fixes #2146

TODO:

- [ ] adjust guide docs
- [ ] adjust README files of extensions
- [ ] finish work and fix test breaks
2014-02-20 05:53:36 +01:00
c92a260a3d Fixes #2415: Added support for inverse relations 2014-02-18 19:43:05 -05:00
0c38655217 psr-4 move 2014-01-10 21:41:43 -05:00