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 !

eZ debug

Timing: Jan 18 2025 15:05:32
Script start
Timing: Jan 18 2025 15:05:32
Module start 'content'
Timing: Jan 18 2025 15:05:33
Module end 'content'
Timing: Jan 18 2025 15:05:33
Script end

Main resources:

Total runtime0.7415 sec
Peak memory usage4,096.0000 KB
Database Queries58

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 587.8594180.8125
Module start 'content' 0.00610.7146 768.6719476.8672
Module end 'content' 0.72070.0208 1,245.539142.3672
Script end 0.7414  1,287.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4286140.0002
Check MTime0.00140.1864140.0001
Mysql Total
Database connection0.00070.093710.0007
Mysqli_queries0.682392.0107580.0118
Looping result0.00050.0708560.0000
Template Total0.713296.220.3566
Template load0.00200.276320.0010
Template processing0.711295.902220.3556
Template load and register function0.00020.031810.0002
states
state_id_array0.00070.088910.0007
state_identifier_array0.00090.127420.0005
Override
Cache load0.00170.2264240.0001
Sytem overhead
Fetch class attribute can translate value0.00100.130220.0005
Fetch class attribute name0.00130.173530.0004
XML
Image XML parsing0.00070.093720.0003
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.01061.4360120.0009
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs