src/Webpage/Traits/HasContent.php
public function take(int $max = null)
    {
        $items = $this->get('items');

        if (!isset($max)) {
            $max = $items->count();
        }
        if ($items->count() >= $max) {
            $items = $items->take($max);
        }

        $this->content['items'] = $items;

        return $this;
    }
public function take(int $max = null)
    {
        $items = $this->get('items');

        if (!isset($max)) {
            $max = $items->count();
        }
        if ($items->count() >= $max) {
            $items = $items->take($max);
        }

        $this->content['items'] = $items;

        return $this;
    }
public function take ( int $ max = null ) { $ items = $ this -> get ( 'items' ) ; if ( ! isset ( $ max ) ) { $ max = $ items -> count ( ) ; } if ( $ items -> count ( ) >= $ max ) { $ items = $ items -> take ( $ max ) ; } $ this -> content [ 'items' ] = $ items ; return $ this ; }
Limit the number of items returned

@param int $max
@return Model
Limit the number of items returned