diff --git a/bridges/KununuBridge.php b/bridges/KununuBridge.php index 7cc4af60..e26292d6 100644 --- a/bridges/KununuBridge.php +++ b/bridges/KununuBridge.php @@ -34,6 +34,12 @@ class KununuBridge extends BridgeAbstract { 'name' => 'Include benefits', 'type' => 'checkbox', 'title' => 'Activate to include benefits in the feed' + ), + 'limit' => array( + 'name' => 'Limit', + 'type' => 'number', + 'defaultValue' => 3, + 'title' => "Maximum number of items to return in the feed.\n0 = unlimited" ) ), array( @@ -108,6 +114,8 @@ class KununuBridge extends BridgeAbstract { $articles = $section->find('article') or returnServerError('Unable to find articles!'); + $limit = $this->getInput('limit') ?: 0; + // Go through all articles foreach($articles as $article) { @@ -141,6 +149,8 @@ class KununuBridge extends BridgeAbstract { $this->items[] = $item; + if ($limit > 0 && count($this->items) >= $limit) break; + } }