protected function getPaginatedMembers()
    {
        $members = [];

        $keys = array_keys($this->attributes);

        // We need to filter out the model attributes so
        // we only retrieve the member range.
        $attributes = array_values(array_filter($keys, function ($key) {
            return strpos($key,'member;range') !== false;
        }));

        // We'll grab the member range key so we can run a
        // regex on it to determine the range.
        $key = reset($attributes);

        preg_match_all(
            '/member;range\=([0-9]{1,4})-([0-9*]{1,4})/',
            $key,
            $matches
        );

        if ($key && count($matches) == 3) {
            // Retrieve the ending range number.
            $to = $matches[2][0];

            // Retrieve the current groups members from the
            // current range string (ex. 'member;0-50').
            $members = $this->getMembersFromAttribute($key);

            // If the query already included all member results (indicated
            // by the '*'), then we can return here. Otherwise we need
            // to continue on and retrieve the rest.
            if($to === '*') {
                return $members;
            }

            // Determine the amount of members we're requesting per query.
            $range = $to - $matches[1][0];

            // Set our starting range to our last end range plus one.
            $from = $to + 1;

            // We'll determine the new end range by adding the
            // total range to our new starting range.
            $to = $from + $range;

            // We'll need to query for the current model again but with
            // a new range to retrieve the other members.
            /** @var Group $group */
            $group = $this->query->newInstance()->findByDn(
                $this->getDn(),
                [$this->query->getSchema()->memberRange($from, $to)]
            );

            // Finally, we'll merge our current members
            // with the newly returned members.
            $members = array_merge(
                $members,
                $group->getMembers()->toArray()
            );
        }

        return $members;
    }
protected function getPaginatedMembers()
    {
        $members = [];

        $keys = array_keys($this->attributes);

        // We need to filter out the model attributes so
        // we only retrieve the member range.
        $attributes = array_values(array_filter($keys, function ($key) {
            return strpos($key,'member;range') !== false;
        }));

        // We'll grab the member range key so we can run a
        // regex on it to determine the range.
        $key = reset($attributes);

        preg_match_all(
            '/member;range\=([0-9]{1,4})-([0-9*]{1,4})/',
            $key,
            $matches
        );

        if ($key && count($matches) == 3) {
            // Retrieve the ending range number.
            $to = $matches[2][0];

            // Retrieve the current groups members from the
            // current range string (ex. 'member;0-50').
            $members = $this->getMembersFromAttribute($key);

            // If the query already included all member results (indicated
            // by the '*'), then we can return here. Otherwise we need
            // to continue on and retrieve the rest.
            if($to === '*') {
                return $members;
            }

            // Determine the amount of members we're requesting per query.
            $range = $to - $matches[1][0];

            // Set our starting range to our last end range plus one.
            $from = $to + 1;

            // We'll determine the new end range by adding the
            // total range to our new starting range.
            $to = $from + $range;

            // We'll need to query for the current model again but with
            // a new range to retrieve the other members.
            /** @var Group $group */
            $group = $this->query->newInstance()->findByDn(
                $this->getDn(),
                [$this->query->getSchema()->memberRange($from, $to)]
            );

            // Finally, we'll merge our current members
            // with the newly returned members.
            $members = array_merge(
                $members,
                $group->getMembers()->toArray()
            );
        }

        return $members;
    }
protected function getPaginatedMembers ( ) { $ members = [ ] ; $ keys = array_keys ( $ this -> attributes ) ; // We need to filter out the model attributes so // we only retrieve the member range. $ attributes = array_values ( array_filter ( $ keys , function ( $ key ) { return strpos ( $ key , 'member;range' ) !== false ; } ) ) ; // We'll grab the member range key so we can run a // regex on it to determine the range. $ key = reset ( $ attributes ) ; preg_match_all ( '/member;range\=([0-9]{1,4})-([0-9*]{1,4})/' , $ key , $ matches ) ; if ( $ key && count ( $ matches ) == 3 ) { // Retrieve the ending range number. $ to = $ matches [ 2 ] [ 0 ] ; // Retrieve the current groups members from the // current range string (ex. 'member;0-50'). $ members = $ this -> getMembersFromAttribute ( $ key ) ; // If the query already included all member results (indicated // by the '*'), then we can return here. Otherwise we need // to continue on and retrieve the rest. if ( $ to === '*' ) { return $ members ; } // Determine the amount of members we're requesting per query. $ range = $ to - $ matches [ 1 ] [ 0 ] ; // Set our starting range to our last end range plus one. $ from = $ to + 1 ; // We'll determine the new end range by adding the // total range to our new starting range. $ to = $ from + $ range ; // We'll need to query for the current model again but with // a new range to retrieve the other members. /** @var Group $group */ $ group = $ this -> query -> newInstance ( ) -> findByDn ( $ this -> getDn ( ) , [ $ this -> query -> getSchema ( ) -> memberRange ( $ from , $ to ) ] ) ; // Finally, we'll merge our current members // with the newly returned members. $ members = array_merge ( $ members , $ group -> getMembers ( ) -> toArray ( ) ) ; } return $ members ; }
Retrieves members that are contained in a member range.

@return array
Retrieves members that are contained in a member range .