Selecting no fields of a table joined in a Zend_Db_Select
I want to be able to use joins to limit the result set I get from a query, but I don’t want to actually select any values from the table I’m joining on, merely use it for making sure what I get back is what I asked for. However it seems there’s no way of saying “don’t select ANY columns from this joined table”.
Code (php)
-
-
$select->from(‘registereduser’, ‘*’)
-
->joinInner(’sessionbooking’, ‘registereduser.id=sessionbooking.userid’,
-
new Zend_Db_Expr(’sessionbooking.status as status’))
-
->joinInner(’sessiontime’, ’sessiontime.id=sessionbooking.sessionid’, ”)
-
->where(’sessiontime.id=?’);
-
So far I’ve resorted to adding something into Zend_Db_Select::_tableCols() to check if the $cols is empty or null and returning if that’s the case. Am I just going about constructing my query incorrectly?