Last active
February 14, 2020 10:11
-
-
Save isopen/389be98683bb3efcdc39bff4c9b533d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ... | |
| /** | |
| * https://github.com/yiisoft/yii/issues/1197 | |
| * | |
| * @param bool $resetDefault | |
| * | |
| * @return $this|GxActiveRecord | |
| */ | |
| public function resetScope($resetDefault = true) | |
| { | |
| $c = $this->getDbCriteria(); | |
| if ($resetDefault) { | |
| $CDbCriteria = new CDbCriteria(); | |
| if (!empty($c)) { | |
| foreach ($c as $key => $value) { | |
| $c->$key = $CDbCriteria->$key; | |
| } | |
| } | |
| } else { | |
| $c = null; | |
| } | |
| $this->setDbCriteria($c); | |
| return $this; | |
| } | |
| .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ... | |
| relations:resetScope | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment