Skip to content

Commit b10693f

Browse files
committed
Query::utilize(): Allow arrays as argument type too
1 parent 28b9f37 commit b10693f

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
@@ -312,14 +312,16 @@ public function getUtilize()
312312
/**
313313
* Add a relation to utilize (join)
314314
*
315-
* @param string $path
315+
* @param string|array $paths
316316
*
317317
* @return $this
318318
*/
319-
public function utilize($path)
319+
public function utilize($paths)
320320
{
321-
$path = $this->getResolver()->qualifyPath($path, $this->getModel()->getTableName());
322-
$this->utilize[$path] = $this->getResolver()->resolveRelation($path);
321+
foreach ((array) $paths as $path) {
322+
$path = $this->getResolver()->qualifyPath($path, $this->getModel()->getTableName());
323+
$this->utilize[$path] = $this->getResolver()->resolveRelation($path);
324+
}
323325

324326
return $this;
325327
}

0 commit comments

Comments
 (0)