I created a pog object For a users table. I want to add a query to it
that checks if a user exists (via his username not userid). I will
add this function and query myself. However, what if requirements
change and I have to add a field? Does this mean I need to re-add my
function or is there some better way?
you can extend your users object and put the query there. Thus, when
you regenerate the base object, it won't affect your custom function.
moreover, as from 3.0 you'll be able to write a plugin to allow this
sort of customization, but on a project level... i.e. you can create a
plugin which will check if an object exist based on an arbitrary field
instead of object id.
option 1 seems to be the best solution for you. #2 is to make custom
function even more generic and re-usable.
regards,
joel
On Apr 18, 4:23 pm, "ctrappber...@gmail.com" <ctrappber...@gmail.com>
wrote:
// example code. Not tested
function check_user_exist($username) {
$user= new user();
$user = $user->GetList(array(array("username", "=", $username));
If count($user>0) {
return true;
}
else
return false;
}
}
Regards,
Paris Paraskeva
Managing Director
M.E. & E. United Worx Ltd
33, Apostolou Pavlou Avenue, Office 103, 8046 Paphos, Cyprus
Tel.: +357 26220707, +357 26221313, Mob.: +357 99575501
Fax.: +357 26221002
pa...@unitedworx.com
www.unitedworx.com
The information contained in this email message(and any attachments) is
legally privileged and confidential information intended only for the use of
the addressee(s) listed on this email. If the reader of this message is not
the intended recipient you are hereby notified that any dissemination,
distribution or copy of this email is strictly prohibited. If you have
received this email in error, please notify us by telephone or email on the
contact details shown on the end of this email. Thank you.
Hi,
__________ NOD32 2202 (20070418) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com