Skip to content

Commit f9a2259

Browse files
Removed debugging code, added comment
1 parent 9fecbec commit f9a2259

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

behaviors/CheckReferentialConstraintsBehavior.php

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class CheckReferentialConstraintsBehavior extends Behavior {
1414

1515
/**
1616
* @var array : Array of relations names, eg. `client`, `posts`, `userRoles` which matches the model's methods `getClient()`, `getPosts()`, `getUserRoles()`
17+
*
18+
* It is not possible to automatically iterate over all relations (see https://github.com/yiisoft/yii2/issues/7710), therefore we do it like this -
19+
* unless we want to use Reflection like here: https://github.com/yiisoft/yii2/issues/1282
1720
*/
1821
public $relations = [];
1922

behaviors/LoggingBehavior.php

-3
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ public function logChanges($event) {
118118
if (!empty($this->baseClasses)) {
119119
foreach ($this->baseClasses as $fqClassName) {
120120
if ($event->sender instanceOf $fqClassName) {
121-
file_put_contents(\Yii::getAlias('@runtime/dump.txt'), print_r(get_class($event->sender) .' is instance of '. $fqClassName, true) ."\r\n--------------------- line ". __LINE__ ." in ". __FILE__ ." at ". date('Y-m-d H:i:s') ."\r\n\r\n\r\n", FILE_APPEND);
122121
$modelClass = $fqClassName;
123-
} else {
124-
file_put_contents(\Yii::getAlias('@runtime/dump.txt'), print_r(get_class($event->sender) .' is not instance of '. $fqClassName, true) ."\r\n--------------------- line ". __LINE__ ." in ". __FILE__ ." at ". date('Y-m-d H:i:s') ."\r\n\r\n\r\n", FILE_APPEND);
125122
}
126123
}
127124
}

0 commit comments

Comments
 (0)