Code
/**
* get a specific block placement
* @author Mark West
* @param int $args['bid'] block id
* @return mixed item array, or false on failure
*/
function Blocks_userapi_getplacement($args)
{
// Argument check
if (!isset($args['bid']) || !is_numeric($args['bid'])) {
pnSessionSetVar('errormsg', _MODARGSERROR);
return false;
}
return DBUtil::selectObjectByID('block_placements', $args['bid'], 'bid');
}
* get a specific block placement
* @author Mark West
* @param int $args['bid'] block id
* @return mixed item array, or false on failure
*/
function Blocks_userapi_getplacement($args)
{
// Argument check
if (!isset($args['bid']) || !is_numeric($args['bid'])) {
pnSessionSetVar('errormsg', _MODARGSERROR);
return false;
}
return DBUtil::selectObjectByID('block_placements', $args['bid'], 'bid');
}
Is there another way to do this? I am a little concerned at the all the DB hits I need to gather the block info, would it be better to use some type of JOIN to retrieve all the blocks data at once (ie blockinfo and placement)? It would be nice if this could be done like the Blocks_userapi_getall($args) function, but with the added placement info...
Thanks for any advice on this...
-Lobos
--
-Lobos
Professional PHP Framework Services: Concept, Development and Deployment
