Skip to content

Commit

Permalink
fix stan
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 16, 2022
1 parent d91be39 commit ac92724
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/Model/Join.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,12 @@ protected function createFakeForeignModel(): Model

public function getForeignModel(): Model
{
if (is_string($this->foreign_table)) {
// TODO this should be removed in the future
if (!isset($this->getOwner()->with[$this->foreign_table])) {
return $this->createFakeForeignModel();
}

return $this->getOwner()->with[$this->foreign_table]['model'];
// TODO this should be removed in the future
if (!isset($this->getOwner()->with[$this->foreign_table])) {
return $this->createFakeForeignModel();
}

$this->foreign_table->assertIsModel();

return $this->foreign_table;
return $this->getOwner()->with[$this->foreign_table]['model'];
}

/**
Expand Down

0 comments on commit ac92724

Please sign in to comment.