getContentList
To have getContentList to be able to filter not only on information in the content table but also on infomation on the foreign object and to be able to give back information not only from the content table but from the foriegn object
Proposal
Call example:
$hash['max_records'] = -1; $hash['offset'] = 0; $hash['pigeonholes'] = array(316,334); // use the service pigeonhole - an array of categories = OR between categories $hash['last_modified'] = '1156533432'; // use filter on liberty_content - modified since $hash['content_type_guid'] = array( 'musicartist', 'bituser');// use filter on liberty_content $res = $gBitUser->getContentList($hash); echo "<pre>";print_r($res);
For each content_type_guid, a function will be called if exists. All the currnet hash are passed to this function so that the filter can use input parameter. the output can be an array $pSqlselect>'select', an array $pSqljoin>'join', an array $pSqlwhere>'where',$pBindVarsselect>'select', an array $pBindVarsjoin>'join', an array $pBindVarswhere>'where',
function getFilterSql(&$pSql, &$pBindVars, $pHash = null) { $pSql['select'][] = $this->mDb->Concat('?',"music_artist.`artist_id`" )." AS musicartist_url"; $pSql['join'][] = "LEFT JOIN `".BIT_DB_PREFIX."music_artist` music_artist ON( music_artist.`content_id` = lc.`content_id` )"; $pBindVars[] = "'".MUSIC_PKG_URL."artist.php?artist_id='"; }
The limitation:
- each returned select field must be name differently . Ex: you can not use display_url but musicartist_url
Objective:
As soon as such function will be created, we will delete in the actual getContentList the horrible slow loop that for each object go to fetch display_url, display_link and title - 2or 3 queries per object.
THe code wil looks like
if (!empty($aux[$type.'url'])) { $aux['display_url'] = $aux[$type.'url'] }else { $aux['display_url'] = $type['content_object']->getDisplayUrl( $aux['content_id'], $aux ); }
Related Items
Documentation » Technical Documentation
Documentation geared towards developers and people who want to learn about the core processes of bitweaver
HEAD ON! Support has been added for Pear::DB! • Oracle Reservations for Two • ReleaseTwo: Shedding that last bits of our roots, finding the core of our being • getContentList • How to add a pagination to an object list • Moving bw in another directory • safe mode on / open_base_dir • sequence and auto • APIDocumentation • Archived Picture Upload with Fisheye under Windows • Bitweaver and Browser Cookies • bitweaverCVS • bitweaverFeatures • bitweaverPerformance • CodingGuidelines • Contribute Code • CreatingServices • CssSchema • InstallbitweaverDoc • IntegrationTutorial • LibertyFormats • LibertyMime • LibertyServices • MySQL encoding issues • phpdoc content status • PortingTikiWikiPackages • PrototypeAjaxObject • PrototypeReference • SamplePackage • SearchPackageDevNotes • TUTORIAL - Displaying Icons ONLY to AUTHORS of the page • Tutorial - Liberty Plugins • Tutorial - Liberty Plugins II • UsersDoc
Comments