CVS update: /cowiki/includes/cowiki/class/dao/

[email protected] 26 May 2005 21:55:50 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 2005/05/26 14:55:50

Modified:
   cowiki/includes/cowiki/class/dao/class.UserDAOMySQL.php
   cowiki/includes/cowiki/class/dao/class.AbstractUserDAO.php

Log:
 Documentation fixes

File Changes:

Directory: /cowiki/includes/cowiki/class/dao/
=============================================

File [changed]: class.UserDAOMySQL.php
Url: http://cowiki.tigris.org/source/browse/cowiki/includes/cowiki/class/dao/class.UserDAOMySQL.php?r1=1.24&r2=1.25
Delta lines:  +47 -64
---------------------
--- class.UserDAOMySQL.php	12 May 2005 21:42:36 -0000	1.24
+++ class.UserDAOMySQL.php	26 May 2005 21:55:48 -0000	1.25
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.UserDAOMySQL.php,v 1.24 2005/05/12 21:42:36 dgorski Exp $
+ * $Id: class.UserDAOMySQL.php,v 1.25 2005/05/26 21:55:48 dgorski Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -17,7 +17,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.24 $
+ * @version     $Revision: 1.25 $
  *
  */
 
@@ -121,7 +121,7 @@
     // --------------------------------------------------------------------
 
     /**
-     * Users stored in MySQL has a "user active" flag, reflect it
+     * Users stored in a SQL database has a "user active" flag, reflect it.
      *
      * @access  public
      * @return  boolean
@@ -136,7 +136,7 @@
     // --------------------------------------------------------------------
 
     /**
-     * Users stored in MySQL has a "user locked" flag, reflect it
+     * Users stored in a SQL database has a "user locked" flag, reflect it.
      *
      * @access  public
      * @return  boolean
@@ -151,18 +151,15 @@
     // --------------------------------------------------------------------
 
     /**
-     * Get user by uid
+     * Get user by uid (user id). Returns null if no user has been found.
      *
      * @access  public
-     * @param   integer
-     * @return  mixed
+     * @param   integer User id
+     * @return  object  User object or null if no user with this user id
+     *                  has been found.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nId"
-     * @todo    [D11N]  Check return type
      */
     public function getUserByUid($nId) {
         // FIX, do not get all if it is not necessary
@@ -174,17 +171,15 @@
     // --------------------------------------------------------------------
 
     /**
-     * Get user by login
+     * Get user by login. Returns null if no user has been found.
      *
      * @access  public
-     * @param   string
-     * @return  mixed
+     * @param   integer User id
+     * @return  object  User object or null if no user with this user id
+     *                  has been found.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check return type
      */
     public function getUserByLogin($sLogin) {
         // FIX, do not get all if it is not necessary
@@ -196,17 +191,17 @@
     // --------------------------------------------------------------------
 
     /**
-     * Get all users
+     * Get all users.
      *
      * @access  public
      * @param   boolean
-     * @return  mixed
+     * @return  Vector  Vector with user objects
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [FIX]   think about caching the results. What about 10.000 ldap
+     * @todo    [FIX]   think about caching the results.
      */
     public function getAllUsers($bGetGuests = true) {
 
@@ -285,17 +280,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Store user
+     * Store user.
      *
      * @access  public
-     * @param   object
-     * @return  mixed
+     * @param   object  User object
+     * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$User"
      */
     public function storeUser($User) {
         $Context = RuntimeContext::getInstance();
@@ -525,17 +519,17 @@
     // --------------------------------------------------------------------
 
     /**
-     * Store users
+     * Store users.
      *
      * @access  public
-     * @param   object
-     * @return  boolean
+     * @param   object  Collection (Vector) of User objects
+     * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$Users"
+     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     public function storeUsers($Users) {
         $bSuccess = true;
@@ -572,17 +566,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Remove user
+     * Remove user.
      *
      * @access  public
-     * @param   object
-     * @return  mixed
+     * @param   object  User object
+     * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$User"
      */
     public function removeUser($User) {
         $Context = RuntimeContext::getInstance();
@@ -623,18 +616,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Get group by gid
+     * Get group by gid (group id). Returns null if no group with this id
+     * has been found.
      *
      * @access  public
-     * @param   integer
-     * @return  mixed
+     * @param   integer Group id
+     * @return  object  Group object or null if no group with this group id
+     *                  has been found.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nId"
-     * @todo    [D11N]  Check return type
      */
     public function getGroupByGid($nId) {
         // FIX, do not get all if it is not necessary
@@ -646,16 +637,15 @@
     // --------------------------------------------------------------------
 
     /**
-     * Get all groups
+     * Get all user groups.
      *
      * @access  public
-     * @return  mixed
+     * @return  object  Vector containing Group objects
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [FIX]   think about caching the results
      */
     public function getAllGroups() {
 
@@ -715,17 +705,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Store group
+     * Store user group.
      *
      * @access  public
-     * @param   object
-     * @return  mixed
+     * @param   object  Group object.
+     * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$Group"
      */
     public function storeGroup($Group) {
         $Context = RuntimeContext::getInstance();
@@ -860,17 +849,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Store groups
+     * Store user groups.
      *
      * @access  public
-     * @param   object
-     * @return  boolean
+     * @param   object  Collection (Vector) containing Group objects.
+     * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$Groups"
      */
     public function storeGroups($Groups) {
         $bSuccess = true;
@@ -904,17 +892,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Remove group
+     * Remove user group.
      *
      * @access  public
-     * @param   object
-     * @return  mixed
+     * @param   object  Group object.
+     * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$Group"
      */
     public function removeGroup($Group) {
         $Context = RuntimeContext::getInstance();
@@ -955,18 +942,16 @@
     // --------------------------------------------------------------------
 
     /**
-     * Get member groups of uid
+     * Return member groups of the given uid (user id)
      *
      * @access  public
-     * @param   integer
-     * @return  object
+     * @param   integer User id (uid)
+     * @return  object  Vector containing users member Group objects
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nId"
-     * @todo    [D11N]  Check return type
      */
     public function getMemberGroupsOfUid($nId) {
 
@@ -1005,19 +990,17 @@
     // --------------------------------------------------------------------
 
     /**
-     * Store member groups of uid
+     * Store member groups of the given uid (user id).
      *
      * @access  protected
-     * @param   object
-     * @param   integer
+     * @param   object  Vector containing Group objects
+     * @param   integer User id
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$Groups"
-     * @todo    [D11N]  Check the parameter type of "$nId"
      */
     protected function storeMemberGroupsOfUid($Groups, $nId) {
 

File [changed]: class.AbstractUserDAO.php
Url: http://cowiki.tigris.org/source/browse/cowiki/includes/cowiki/class/dao/class.AbstractUserDAO.php?r1=1.12&r2=1.13
Delta lines:  +45 -73
---------------------
--- class.AbstractUserDAO.php	29 Jan 2005 15:32:36 -0000	1.12
+++ class.AbstractUserDAO.php	26 May 2005 21:55:48 -0000	1.13
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.AbstractUserDAO.php,v 1.12 2005/01/29 15:32:36 dgorski Exp $
+ * $Id: class.AbstractUserDAO.php,v 1.13 2005/05/26 21:55:48 dgorski Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -17,7 +17,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.12 $
+ * @version     $Revision: 1.13 $
  *
  */
 
@@ -118,24 +118,27 @@
     // --------------------------------------------------------------------
 
     /**
-     * Abstract methods to be implemented by a subclass
+     * Users stored in a SQL database has a "user active" flag, reflect it.
+     * Abstract method to be implemented by a subclass.
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @return  boolean Returns true if user storage has an active flag,
+     *                  false otherwise.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function hasUserActiveFlag();
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Users stored in a SQL database has a "user locked" flag, reflect it.
+     * Abstract method to be implemented by a subclass.
+     *
+     * @access  public
+     * @return  boolean Returns true if user storage has a locked flag,
+     *                  false otherwise.
      *
      * @access  public
      * @param   integer
@@ -144,92 +147,76 @@
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function hasUserLockedFlag();
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Get user by uid (user id). Returns null if no user has been found.
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @param   integer User id
+     * @return  object  User object or null if no user with this user id
+     *                  has been found.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function getUserByUid($nId);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Get user by login. Returns null if no user has been found.
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @param   integer User id
+     * @return  object  User object or null if no user with this user id
+     *                  has been found.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function getUserByLogin($sLogin);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Get all users.
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @param   boolean
+     * @return  Vector  Vector with user objects
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function getAllUsers($bGetGuests = true);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Store user.
      *
      * @access  public
-     * @param   integer
-     * @param   string
+     * @param   object  User object
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function storeUser($User);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Store users.
      *
      * @access  public
-     * @param   integer
-     * @param   string
+     * @param   object  Collection (Vector) of User objects
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
@@ -243,126 +230,111 @@
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Remove user.
      *
      * @access  public
-     * @param   integer
-     * @param   string
+     * @param   object  User object
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function removeUser($User);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Get group by gid (group id). Returns null if no group with this id
+     * has been found.
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @param   integer Group id
+     * @return  object  Group object or null if no group with this group id
+     *                  has been found.
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
-     *
-     * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function getGroupByGid($nId);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Get all user groups.
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @return  object  Vector containing Group objects
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function getAllGroups();
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Store user group.
      *
      * @access  public
-     * @param   integer
-     * @param   string
+     * @param   object  Group object.
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function storeGroup($Group);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Store user groups.
      *
      * @access  public
-     * @param   integer
-     * @param   string
+     * @param   object  Collection (Vector) containing Group objects.
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function storeGroups($Collection);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Remove user group.
      *
      * @access  public
-     * @param   integer
-     * @param   string
+     * @param   object  Group object.
      * @return  void
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function removeGroup($Group);
 
     // --------------------------------------------------------------------
 
     /**
-     * Is ignored account
+     * Return member groups of the given uid (user id)
      *
      * @access  public
-     * @param   integer
-     * @param   string
-     * @return  void
+     * @param   integer User id (uid)
+     * @return  object  Vector containing users member Group objects
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
      *
      * @todo    [D11N]  Check description
-     * @todo    [D11N]  Check the parameter type of "$nUid"
      */
     abstract function getMemberGroupsOfUid($nId);