Help testing for user

Author Message

Graham Tillotson

Thursday 14 October 2004 1:57:25 pm

I'm working on an extension and could use help testing for the existence of a user. Here is what I'm trying to do:

$user =& $userClass->fetchByEmail($emailAddress);
// if user not found, then create

Any help on this would be appreciated. My PHP is a bit weak.

DUO : CONSULTING
Web content management experts
www.duoconsulting.com

Björn Dieding@xrow.de

Thursday 14 October 2004 3:18:35 pm

from eZUser you can read

    function &fetchByEmail( $email, $asObject = true )
    {
        $user =& eZPersistentObject::fetchObject( eZUser::definition(),
                                                  null,
                                                  array( 'email' => $email ),
                                                  $asObject );
        return $user;
    }

so

$user =& eZUser::fetchByEmail( $email ); 

have fun coding

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

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 19 2025 03:33:40
Script start
Timing: Jan 19 2025 03:33:40
Module start 'layout'
Timing: Jan 19 2025 03:33:40
Module start 'content'
Timing: Jan 19 2025 03:33:41
Module end 'content'
Timing: Jan 19 2025 03:33:41
Script end

Main resources:

Total runtime1.2029 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 590.2656152.6094
Module start 'layout' 0.00540.0032 742.875039.4141
Module start 'content' 0.00861.1930 782.2891530.5156
Module end 'content' 1.20160.0013 1,312.80478.1875
Script end 1.2029  1,320.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2751160.0002
Check MTime0.00140.1174160.0001
Mysql Total
Database connection0.00070.059710.0007
Mysqli_queries1.155296.0297540.0214
Looping result0.00050.0450520.0000
Template Total1.174997.720.5875
Template load0.00210.171320.0010
Template processing1.172997.499220.5864
Template load and register function0.00030.021210.0003
states
state_id_array0.00090.072410.0009
state_identifier_array0.00100.084320.0005
Override
Cache load0.00170.1434140.0001
Sytem overhead
Fetch class attribute can translate value0.00160.129820.0008
Fetch class attribute name0.00120.100040.0003
XML
Image XML parsing0.00190.154620.0009
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00110.0909220.0000
String conversion0.00000.000840.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 6

Time used to render debug report: 0.0001 secs