Selecting all users in a group using the groupID.

Author Message

Clemens T

Thursday 01 September 2005 1:45:56 pm

Heya All!
I'm currently developing an extension which basically loops through a list of users that are grouped in a userGroup, now.. the way I get the ID of this user group is:

        $db =& eZDB::instance();

                    $groupName = "SuperUserList";
                    $groupQuery = "SELECT ezcontentobject_tree.node_id
                                       FROM ezcontentobject, ezcontentobject_tree
                                       WHERE ezcontentobject.name='$groupName'
                                       AND ezcontentobject.id=ezcontentobject_tree.contentobject_id";
                    $groupObject = $db->arrayQuery( $groupQuery );

The following question remains: How can I loop through the users of the groups with the ID's provided by the query above?

I know I'm close, I just don't know how...

Thanks, I'm stuck!

Clemens
ps: or can I use ::fetchList..? Can anyone explain to me what the best method is?

Kristof Coomans

Thursday 01 September 2005 10:55:50 pm

If all users you want to fetch are directly under that group, you can use <i>eZContentObjectTreeNode::fetchList</i>.

If they are further divided into groups under the group you found with the query, you can use <i>eZContentObjectTreeNode::subTree</i>.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Clemens T

Friday 02 September 2005 3:34:23 am

Thanks a lot, I'll publish my code once it's done...(still under progress)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:21:23
Script start
Timing: Jan 18 2025 22:21:23
Module start 'layout'
Timing: Jan 18 2025 22:21:23
Module start 'content'
Timing: Jan 18 2025 22:21:24
Module end 'content'
Timing: Jan 18 2025 22:21:24
Script end

Main resources:

Total runtime0.6642 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 589.1797152.6406
Module start 'layout' 0.00430.0022 741.820339.4766
Module start 'content' 0.00650.6562 781.2969533.7188
Module end 'content' 0.66270.0015 1,315.015612.1250
Script end 0.6642  1,327.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4528160.0002
Check MTime0.00120.1856160.0001
Mysql Total
Database connection0.00050.069610.0005
Mysqli_queries0.626694.3400570.0110
Looping result0.00050.0718550.0000
Template Total0.640596.420.3203
Template load0.00200.295420.0010
Template processing0.638696.134620.3193
Template load and register function0.00010.020910.0001
states
state_id_array0.00060.097810.0006
state_identifier_array0.00090.141820.0005
Override
Cache load0.00160.2413170.0001
Sytem overhead
Fetch class attribute can translate value0.00080.124220.0004
Fetch class attribute name0.00090.131340.0002
XML
Image XML parsing0.00060.092520.0003
class_abstraction
Instantiating content class attribute0.00000.001540.0000
General
dbfile0.00070.1105160.0000
String conversion0.00000.001340.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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs