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

[email protected] 12 Apr 2005 18:07:27 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 05/04/12 11:07:27

Modified:
 /cowiki/includes/cowiki/class/dao/
  class.StorageMySQL.php

Log:
 Added "protected function setLastInsertId()"

File Changes:

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

File [changed]: class.StorageMySQL.php
Url: http://cowiki.tigris.org/source/browse/cowiki/includes/cowiki/class/dao/class.StorageMySQL.php?r1=1.21&r2=1.22
Delta lines:  +16 -8
--------------------
--- class.StorageMySQL.php	28 Jan 2005 21:53:51 -0000	1.21
+++ class.StorageMySQL.php	12 Apr 2005 18:07:27 -0000	1.22
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.StorageMySQL.php,v 1.21 2005/01/28 21:53:51 dgorski Exp $
+ * $Id: class.StorageMySQL.php,v 1.22 2005/04/12 18:07:27 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,12 +17,15 @@
  * @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.21 $
+ * @version     $Revision: 1.22 $
  *
  */
 
 /**
- * coWiki - Storage MySQL class
+ * This class is the MySQL (MyISAM/InnoDB) access abstraction layer.
+ * It provides basic database access methods like INSERT, UPDATE or just
+ * a simple query (SELECT). It is intentionally kept very simple and is
+ * only a helper, but not a real persistence layer.
  *
  * @package     dao
  * @subpackage  class
@@ -44,7 +47,7 @@
     // --------------------------------------------------------------------
 
     /**
-     * Class constructor
+     * Class constructor.
      *
      * @access  public
      * @return  void
@@ -70,7 +73,7 @@
      * @param   string
      * @param   string
      * @param   string
-     * @return  object
+     * @return  boolean
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
@@ -119,7 +122,6 @@
      * @todo    [D11N]  Check return type
      */
     public function query($sQuery, $mQueryType = null) {
-        //echo $sQuery.'<hr />'; // Debug output
 
         if (!$this->rResult = @mysql_query($sQuery, $this->rLink)) {
             // {{{ DEBUG }}}
@@ -193,7 +195,7 @@
      * @param   string
      * @param   integer
      * @param   integer
-     * @return  mixed
+     * @return  string
      *
      * @author  Daniel T. Gorski, <[email protected]>
      * @since   coWiki 0.3.0
@@ -209,6 +211,12 @@
 
     // --------------------------------------------------------------------
 
+    protected function setLastInsertId() {
+        $this->sLastId = @mysql_insert_id($this->rLink);
+    }
+
+    // --------------------------------------------------------------------
+
     /**
      * Get last insert id
      *
@@ -319,7 +327,7 @@
 
         // Save the "last insert id", it would be falsified by the
         // "endTransaction()" method otherwise.
-        $this->sLastId = @mysql_insert_id($this->rLink);
+        $this->setLastInsertId();
 
         $this->endTransaction($aData['table']);