conditional validating user's register input

Author Message

Jacek S

Wednesday 02 April 2008 3:30:07 pm

Im developing a webshop system and have to make custom users class with field validating based on other field selection. For example class contains fields:
- type, which contains two options: business and private
- value1, which must be filled when user choose private as type
- value2, which must be filled when type = business

How could I make a validator for checking such conditions in during user registration?

Piotrek Karaƛ

Monday 14 April 2008 9:26:28 am

Depending on the project constraints:

- develop a dedicated datatype, and store both the type and its value (there's plenty of space for that in the db)
- introduce two separate user classes

Each one will have its advantages.

Good luck,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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 04:23:08
Script start
Timing: Jan 19 2025 04:23:08
Module start 'layout'
Timing: Jan 19 2025 04:23:08
Module start 'content'
Timing: Jan 19 2025 04:23:10
Module end 'content'
Timing: Jan 19 2025 04:23:10
Script end

Main resources:

Total runtime1.2435 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.0068 589.2891152.6406
Module start 'layout' 0.00680.0044 741.929739.4766
Module start 'content' 0.01121.2309 781.4063523.4922
Module end 'content' 1.24210.0014 1,304.89848.1250
Script end 1.2434  1,313.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3102160.0002
Check MTime0.00140.1089160.0001
Mysql Total
Database connection0.00070.059010.0007
Mysqli_queries1.161493.4013540.0215
Looping result0.00060.0523520.0000
Template Total1.199196.420.5995
Template load0.00250.202220.0013
Template processing1.196596.225120.5983
Template load and register function0.00020.014010.0002
states
state_id_array0.00110.087310.0011
state_identifier_array0.00370.296620.0018
Override
Cache load0.00210.1717160.0001
Sytem overhead
Fetch class attribute can translate value0.00090.071620.0004
Fetch class attribute name0.00120.095830.0004
XML
Image XML parsing0.00130.102420.0006
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00250.1985170.0001
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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs