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

Commit

Permalink
Update ManyToManyRelation.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j authored Nov 16, 2018
1 parent 53c59c8 commit 103927a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function unlink(RecordInterface $record): self
//Removing locally
unset($this->instances[$index]);

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

foreach ($iterator as $pivotData => $item) {
if (in_array($item, $this->instances)) {
if (in_array($item, $this->instances, true)) {
//Skip duplicates (if any?)
continue;
}
Expand Down Expand Up @@ -526,4 +526,4 @@ private function targetRole(): string
ORMInterface::R_ROLE_NAME
);
}
}
}

0 comments on commit 103927a

Please sign in to comment.