jonassanoj / dbpro

DB Project 1
19 stars 1 forks source link

user_model: implement add_user(). document it. #58

Closed tilman-schieber closed 12 years ago

tilman-schieber commented 12 years ago

line 28: implement the add_user function. A new unconfirmed user (userTypeID=0) is created with the given parameters. Set the accountCreationDate to the current date. Document the function using phpdoc.

tilman-schieber commented 12 years ago

Thanks for the quick commit.

  1. Please take another look how a phpdoc comment is structured: http://www.phpdoc.org/docs/latest/for-users/anatomy-of-a-docblock.html Your current comments won't compile correctly (datatypes wrong, comma directly after variable name, no return value documented). Read the guide above or look at question_model::getlist() as an example for a (very) complete documentation.
  2. You should make your private helper function public. Its very useful, e.g. for URIs like github.com/jonassanoj, i.e. directly accessing a named user's homepage. It should be renamed and return the userID instead of boolean. If the user is not found the result is false (userID==0) anyway.
  3. Similiarly, add_user returns true no matter if the insert query succeeds. It makes more sense to return the userID after a successful insert and (false) otherwise (just return $this->db->insert_id())

Note: We can just make username unique in the DB table. The insert will fail automatically and its much more elegant. However your helper function should stay in any case. We'll need it.

ashuqullah commented 12 years ago

thanks sir from your reply and comments i just use auto doc in eclipse, i will come to you tomorrow from 11 to 12 it may just take few minutes i have problem to push from eclipse.

.......................................................................................................... Best Regards Ashuqullah AliziaStudent in TU -Berlin tell: 015776258060

waste no more time talking about great soul and how it should be ,become one yourself. ..............................................................................................................................

Date: Sun, 17 Jun 2012 05:59:21 -0700 From: reply@reply.github.com To: alizai.csf@hotmail.com Subject: Re: [dbpro] user_model: implement add_user(). document it. (#58)

Thanks for the quick commit.

  1. Please take another look how a phpdoc comment is structured: http://www.phpdoc.org/docs/latest/for-users/anatomy-of-a-docblock.html Your current comments won't compile correctly (datatypes wrong, comma directly after variable name, no return value documented). Read the guide above or look at question_model::getlist() as an example for a (very) complete documentation.
  2. You should make your private helper function public. Its very useful, e.g. for URIs like github.com/jonassanoj, i.e. directly accessing a named user's homepage. It should be renamed and return the userID instead of boolean. If the user is not found the result is false (userID==0) anyway.
  3. Similiarly, add_user returns true no matter if the insert query succeeds. userID after a successful insert and 0==false otherwise (just return $this->db->insert_id())
  4. We can just make username unique in the DB table. The insert will fail automatically and its much more elegant. However your helper function should stay in any case. We'll need it.

Reply to this email directly or view it on GitHub: https://github.com/jonassanoj/dbpro/issues/58#issuecomment-6381000

tilman-schieber commented 12 years ago

your implementation works. the format and look of the documentation can still be improved (does not parse correctly in phpdoc) and you should stick to the naming conventions outlined in the wiki