Working on main SQL Query to work with KnpPaginator, implementing the paginator for folder view.