diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php index 3718b2e2..e44e3caa 100644 --- a/bridges/FacebookBridge.php +++ b/bridges/FacebookBridge.php @@ -41,6 +41,15 @@ class FacebookBridge extends BridgeAbstract { 'exampleValue' => 'https://www.facebook.com/groups/743149642484225', 'title' => 'Insert group name or facebook group URL' ) + ), + 'global' => array( + 'limit' => array( + 'name' => 'Limit', + 'type' => 'number', + 'required' => false, + 'title' => 'Specify the number of items to return (default: -1)', + 'defaultValue' => -1 + ) ) ); @@ -117,6 +126,12 @@ class FacebookBridge extends BridgeAbstract { } + $limit = $this->getInput('limit') ?: -1; + + if($limit > 0 && count($this->items) > $limit) { + $this->items = array_slice($this->items, 0, $limit); + } + } #region Group