logo       

cvs: pear /DBA_Relational Table.php: msg#00551

Subject: cvs: pear /DBA_Relational Table.php
busterb         Wed Jan 29 23:16:10 2003 EDT

  Modified files:              
    /pear/DBA_Relational        Table.php 
  Log:
  added firstRow() and nextRow() methods
  
  
Index: pear/DBA_Relational/Table.php
diff -u pear/DBA_Relational/Table.php:1.20 pear/DBA_Relational/Table.php:1.21
--- pear/DBA_Relational/Table.php:1.20  Mon Jan 27 07:12:43 2003
+++ pear/DBA_Relational/Table.php       Wed Jan 29 23:16:10 2003
@@ -18,7 +18,7 @@
 // | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA|
 // +----------------------------------------------------------------------+
 //
-// $Id: Table.php,v 1.20 2003/01/27 12:12:43 busterb Exp $
+// $Id: Table.php,v 1.21 2003/01/30 04:16:10 busterb Exp $
 //
 require_once 'PEAR.php';
 require_once 'DBA.php';
@@ -1005,6 +1005,48 @@
         }
     }
     // }}}
+
+
+       // {{{ firstRow()
+       /**
+        * Returns the first row in the table. The built-in cursor for the
+     * internal _dba object is used, so no other operations should be performed
+     * other than nextRow() if iterating through the rows is the desired
+     * operation
+        *
+     * @access public
+     * @return  mixed PEAR_Error on failure, the row array on success
+        *                or false if there are no elements in the table
+     *                i.e (firstRow() === false) = table is empty
+        */
+    function firstRow()
+    {
+        if ($this->_dba->isOpen()) {
+                       $key = $this->_dba->firstkey();
+                       return $this->_unpackRow($this->_dba->fetch($key));
+        } else {
+            return $this->raiseError('table not open');
+        }
+       }
+       // }}}
+
+       // {{{ firstRow()
+       /**
+        * Returns the next row in the table after a firstRow or nextRow.
+        *
+     * @access public
+     * @return  mixed PEAR_Error on failure, the row array on success
+        *                or false if there are no more elements in the table
+        */
+       function nextRow() {
+        if ($this->_dba->isOpen()) {
+                       $key = $this->_dba->nextkey();
+                       return $this->_unpackRow($this->_dba->fetch($key));
+        } else {
+            return $this->raiseError('table not open');
+        }
+       }
+       // }}}
 
     // {{{
     /**



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe