Skip to content

Commit 3a22918

Browse files
author
Tom Kuijer
committed
Add ability to limit portal results when using the Eloquent query builder
1 parent cdfd2af commit 3a22918

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Database/Eloquent/FMEloquentBuilder.php

+15
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,19 @@ protected function callScope(callable $scope, array $parameters = [])
332332

333333
return $result;
334334
}
335+
336+
/**
337+
* Set the limit of records returned for a portal on the current models' layout.
338+
*
339+
* @param string $portalName Name of the portal
340+
* @param int $limit Number of records to return
341+
*
342+
* @return $this
343+
*/
344+
public function limitPortal(string $portalName, int $limit): static
345+
{
346+
$this->query->limitPortal($portalName, $limit);
347+
348+
return $this;
349+
}
335350
}

0 commit comments

Comments
 (0)