Create new PageList from custom SQL

Permalink
Hi,
How I can to create one PageList from my own SQL query??? Any example for this?? I was watching the example_faq package, but this example don´t showme this.

vinfo
 
jordanlev replied on at Permalink Reply
jordanlev
Are you experienced with PHP coding? If so, you should write your own code that uses the PageList object. You can pass in your own SQL WHERE clause like this:
Loader::model('page_list');
$pl = new PageList();
$pl->filter(false, 'your sql where clause here');
$pages = $pl->get();


But there is a problem because you need to know the names of the fields and tables that are available in that query.

Here is some more info:
http://www.concrete5.org/documentation/developers/pages/searching-a...
http://www.concrete5.org/community/forums/customizing_c5/donand039t...
http://www.concrete5.org/community/forums/customizing_c5/me-too-dum...