Forums / Developer / How to do this query in class definition() MultiSelect' ?!

How to do this query in class definition() MultiSelect' ?!

Author Message

Selmah Maxim

Monday 04 August 2003 6:49:01 am

select
ezcontentobject.id , ezcontentobject.owner_id, ezcontentobject.current_version
from ezcontentobject
where
ezcontentobject.contentclass_id = '15' and
ezcontentobject.owner_id = '$userID' and
ezcontentobject.status = '1'
order by ezcontentobject.id limit 1

Jerry Jalava

Monday 04 August 2003 8:13:33 pm

If I understood you right, then here might be what you are looking for:

[code]
$db =& eZDB::instance();

$asObject = true;

$sqlText = "SELECT ezcontentobject.id, ezcontentobject.owner_id, ezcontentobject.current_version FROM ezcontentobject WHERE ezcontentobject.contentclass_id = '15' and ezcontentobject.owner_id = '$userID' and ezcontentobject.status = '1' ORDER BY ezcontentobject.id limit 1";
$rows =& $db->arrayQuery( $sqlText );

return eZPersistentObject::handleRows( $rows, $class_name, $asObject );
[/code]

Hope this help,
Jerry

Selmah Maxim

Tuesday 05 August 2003 1:02:05 am

yes ... I think so ... but I didn`t see query like this for definition function in all ezp classes !