PerchFactory::get_filtered_listing() - PerchPaging

  • Hi drewm


    I think being able to use PerchFactory::get_filtered_listing() for admin listings would make it easier for app developers to build more complex filterable admin lists where PerchFactory::get_by() isn't enough.


    For non-paginated lists, the method works fine:

    PHP
    1. $items = $Factory->get_filtered_listing(['skip-template' => true]);
    2. echo $AdminListing->render( $Factory->return_instances($items) );


    However, it is trickier to implement paginated lists this way given PerchAdminListing requires a PerchPaging instance for pagination. It would be nice to be able to pass a PerchPaging instance to get_filtered_listing(). Perhaps with an additional parameter:


    PHP
    1. $items = $Factory->get_filtered_listing(['skip-template' => true], $where_callback, $pre_template_callback, $Paging);


    Or by using the existing paginate option:


    PHP
    1. $items = $Factory->get_filtered_listing([
    2. 'skip-template' => true,
    3. 'paginate' => $Paging,
    4. ]);