Open raghul-selvakumar opened 7 years ago
Hi @raghul-selvakumar,
Unfortunately PHP doesn't support LDAP server side sorting at the moment, so we actually retrieve the entire result set to allow sorting since it was a requested feature.
If we sort a result set of returned results from the first paged request, it won't be sorted properly since the entire resulting records haven't been retrieved yet, which will contain out of order results.
If we perform this the other way, we'll need to store the cookie somehow inside the users session to be able to request the next resulting set of LDAP records. This opens a can of worms since users may be using other frameworks for managing sessions instead of PHP's sessions. We would have to create some sort of 'driver' based cookie implementation for each type of implementation that the dev is working with.
We also can't create cookies without devs knowing since this could infringe upon their countries rights (the EU for example).
The current pagination implementation is meant to correct the PHP LDAP sorting issue and bypass max result limits on LDAP servers to be able to retrieve all records instead of being limited to your servers maximum (usually 500 or 1000).
I'm completely open to PR's and talks about implementation of pagination that requests only the requested page of data, but it could be difficult.
Hi @stevebauman
That makes sense. Thank you for your reply steve.
Description:
The paginate function works irrespective of the records per page and current page params. I have made the records per page and current page params as dynamic and following is the code,
For example, if the records per page is 50 and current page is 1, it should return me only 50 records from the beginning, but the above code returns me all the records, exactly 874 records in the AD.
Help will be really appreciated. Thanks