Skip to content

Commit 3c2775a

Browse files
committed
Update RelationTrait.php
1 parent c1c1008 commit 3c2775a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

RelationTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function saveAll()
160160

161161
} catch (\yii\db\IntegrityException $exc) {
162162
$this->addError($name, "Data can't be deleted because it's still used by another data.");
163-
$error = 1;
163+
$error = true;
164164
}
165165
}
166166
}
@@ -189,7 +189,7 @@ public function saveAll()
189189
$relModel->deleteAll(implode(" AND ", $condition));
190190
} catch (\yii\db\IntegrityException $exc) {
191191
$this->addError($rel['name'], "Data can't be deleted because it's still used by another data.");
192-
$error = 1;
192+
$error = true;
193193
}
194194
}else{
195195
foreach ($rel['link'] as $k => $v) {
@@ -199,7 +199,7 @@ public function saveAll()
199199
$relModel->deleteAll(implode(" AND ", $condition));
200200
} catch (\yii\db\IntegrityException $exc) {
201201
$this->addError($rel['name'], "Data can't be deleted because it's still used by another data.");
202-
$error = 1;
202+
$error = true;
203203
}
204204
}
205205
}
@@ -230,7 +230,7 @@ public function deleteWithRelated()
230230
$db = $this->getDb();
231231
$trans = $db->beginTransaction();
232232
try {
233-
$error = 0;
233+
$error = false;
234234
$relData = $this->getRelationData();
235235
foreach ($relData as $data) {
236236
if ($data['ismultiple']) {

0 commit comments

Comments
 (0)