Hello!

http://bin.cakephp.org/saved/66911

I'm not laughing I'm wondering why your code looks so different from
how the book, and everyone else, writes their code.
There are different examples in the manual for the same problem.I'm trying to figure out how those work and apply to my problem, maybe not in a right or better way.
So every of your advice that help me write better code are welcome! :)
nesting calls like that, if nothing else , will make your code harder
to debug/read.
You are right, that's why I have rewrite code like there is no nested calls anymore. ;)

does your code work if membersXmlArray is 10k rows?
Do you really think, that I would import 10k rows with foreach instead of mysql commandline? :D This project is for learning cakephp, so not a serious bussiness application just a simple guild site
with less than 100 members.
So, if through unforseen-error the xml input isn't parsable or any
circumstance where you accidentally call this method with an empty
array - you're happy it's going to truncate your table?
There must be an existence of correct xml node to call this method.
In case when this array is empty would mean remove ALL members. :)

if (isset($xmlArray['QDKP2EXPORT-DKP']))
    $this->_xml_import_members($xmlArray['QDKP2EXPORT-DKP']['PLAYER']);
the find queries can come from many places. any call to exists, or
save are going to check if the row exists on the db. But I wouldn't
worry  about a 0-1ms extra db call until it's your bottleneck (which
is unlikely to ever happen)
It is no problem with extra 1ms. I just wonder why that query runs more than once.

from your another mail:
> PS I'd structure what you're doing like this:

I'm going to check your code. Thanks for your help.

QXY




--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to