Skip to content

Commit 5e9b906

Browse files
committed
Query::utilize(): Allow arrays as argument type too
1 parent 123b7d9 commit 5e9b906

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/Query.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,16 @@ public function getUtilize()
283283
/**
284284
* Add a relation to utilize (join)
285285
*
286-
* @param string $path
286+
* @param string|string[] $paths
287287
*
288288
* @return $this
289289
*/
290-
public function utilize($path)
290+
public function utilize($paths)
291291
{
292-
$path = $this->getResolver()->qualifyPath($path, $this->getModel()->getTableName());
293-
$this->utilize[$path] = $this->getResolver()->resolveRelation($path);
292+
foreach ((array) $paths as $path) {
293+
$path = $this->getResolver()->qualifyPath($path, $this->getModel()->getTableName());
294+
$this->utilize[$path] = $this->getResolver()->resolveRelation($path);
295+
}
294296

295297
return $this;
296298
}

0 commit comments

Comments
 (0)