Skip to content

Commit

Permalink
Update RelationTrait.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mootensai committed Feb 24, 2016
1 parent c1c1008 commit 3c2775a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function saveAll()

} catch (\yii\db\IntegrityException $exc) {
$this->addError($name, "Data can't be deleted because it's still used by another data.");
$error = 1;
$error = true;
}
}
}
Expand Down Expand Up @@ -189,7 +189,7 @@ public function saveAll()
$relModel->deleteAll(implode(" AND ", $condition));
} catch (\yii\db\IntegrityException $exc) {
$this->addError($rel['name'], "Data can't be deleted because it's still used by another data.");
$error = 1;
$error = true;
}
}else{
foreach ($rel['link'] as $k => $v) {
Expand All @@ -199,7 +199,7 @@ public function saveAll()
$relModel->deleteAll(implode(" AND ", $condition));
} catch (\yii\db\IntegrityException $exc) {
$this->addError($rel['name'], "Data can't be deleted because it's still used by another data.");
$error = 1;
$error = true;
}
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ public function deleteWithRelated()
$db = $this->getDb();
$trans = $db->beginTransaction();
try {
$error = 0;
$error = false;
$relData = $this->getRelationData();
foreach ($relData as $data) {
if ($data['ismultiple']) {
Expand Down

0 comments on commit 3c2775a

Please sign in to comment.