From 103927a5af296ad203a5b6b217cba754803d4ee5 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Fri, 16 Nov 2018 11:04:46 +0300 Subject: [PATCH] Update ManyToManyRelation.php --- source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php b/source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php index 28db716..a050b71 100644 --- a/source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php +++ b/source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php @@ -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; } @@ -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; } @@ -526,4 +526,4 @@ private function targetRole(): string ORMInterface::R_ROLE_NAME ); } -} \ No newline at end of file +}