Skip to content

Commit

Permalink
Set container to result instance when doing advanced execute
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijastuden committed Dec 2, 2016
1 parent 66b57e5 commit f5f94a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,12 @@ public function findBySql($type, $sql, ...$arguments)
$return_by_value = $type;
}

return $this->connection->advancedExecute($sql, $arguments, ConnectionInterface::LOAD_ALL_ROWS, $return_by, $return_by_value, [&$this->connection, &$this, &$this->log]);
if ($this->hasContainer()) {
return $this->connection->advancedExecute($sql, $arguments, ConnectionInterface::LOAD_ALL_ROWS, $return_by, $return_by_value, [&$this->connection, &$this, &$this->log], $this->getContainer());
} else {
return $this->connection->advancedExecute($sql, $arguments, ConnectionInterface::LOAD_ALL_ROWS, $return_by, $return_by_value, [&$this->connection, &$this, &$this->log]);
}

} else {
throw new InvalidArgumentException("Type '$type' is not registered");
}
Expand Down

0 comments on commit f5f94a8

Please sign in to comment.