PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser_Admin » Bug #3239

where operator in createWhere in LiveUser_Admin_Storage_SQL be changeable

Details

Request #3239where operator in createWhere in LiveUser_Admin_Storage_SQL be changeable
Submitted2005-01-19 11:55 UTC
Fromfabio at bs2 dot com dot br
StatusSuspended
PackageLiveUser_Admin
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2005-01-19 11:55 UTC] fabio at bs2 dot com dot br

Description:
------------
The where operator is not changeable by parameter

I want to get groups by owner_group_id OR by owner_user_id but the createWhere in LiveUser_Admin_Storage_SQL use operator AND. To do this I use this code:

$params['filters'] = array('owner_group_id' => $owner_id['group']);
$groups[] = $this->perm->getgroups($params);

$params['filters'] = array('owner_user_id' => $owner_id['user']);
$groups[] = $this->perm->getgroups($params);

return array_merge($groups[0] ,$groups[1]);

[2005-01-19 12:11 UTC] smith at backendmedia dot com

I am somewhat hesitant to add OR support to the query builder. While of course it would provide considerable benefit I feel it would make things considerably more complex API wise. What I have been pondering is instead some day allow people to pass a contraint object as a filter similar to how propel (http://propel.phpdb.org/docs/user_guide/chapters/FindingObjects.html#FindingRecods.Criteria) does things. That object would have a toString() method or toSQL() method. However it would be a bit of work to define the API in order to ensure that all fields used in the object are added into the join and the proper table prefixing is done. Something like this would also allow adding parenthesis. However this kind of features will very likely never be provided for any XML variant of the SQL builder.