Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit 103927a

Browse files
authored
Update ManyToManyRelation.php
1 parent 53c59c8 commit 103927a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function unlink(RecordInterface $record): self
220220
//Removing locally
221221
unset($this->instances[$index]);
222222

223-
if (!in_array($linked, $this->scheduled) || !$this->autoload) {
223+
if (!in_array($linked, $this->scheduled, true) || !$this->autoload) {
224224
//Scheduling unlink in db when we know relation OR partial mode is on
225225
$this->unlinked[] = $linked;
226226
}
@@ -466,7 +466,7 @@ protected function initInstances(): MultipleRelation
466466
$iterator = new RecordIterator($this->data, $this->class, $this->orm);
467467

468468
foreach ($iterator as $pivotData => $item) {
469-
if (in_array($item, $this->instances)) {
469+
if (in_array($item, $this->instances, true)) {
470470
//Skip duplicates (if any?)
471471
continue;
472472
}
@@ -526,4 +526,4 @@ private function targetRole(): string
526526
ORMInterface::R_ROLE_NAME
527527
);
528528
}
529-
}
529+
}

0 commit comments

Comments
 (0)