phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc class.sql_builder.inc.php


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgwapi/inc class.sql_builder.inc.php
Date: Tue, 29 Aug 2006 10:12:08 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Changes by:     Dave Hall <skwashd>     06/08/29 10:12:08

Modified files:
        inc            : class.sql_builder.inc.php 

Log message:
        E_NOTICE

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.sql_builder.inc.php?cvsroot=phpgwapi&r1=1.4&r2=1.5

Patches:
Index: class.sql_builder.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/class.sql_builder.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- class.sql_builder.inc.php   29 Aug 2006 04:16:59 -0000      1.4
+++ class.sql_builder.inc.php   29 Aug 2006 10:12:08 -0000      1.5
@@ -8,7 +8,7 @@
        * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage database
-       * @version $Id: class.sql_builder.inc.php,v 1.4 2006/08/29 04:16:59 
skwashd Exp $
+       * @version $Id: class.sql_builder.inc.php,v 1.5 2006/08/29 10:12:08 
skwashd Exp $
        * @internal Development of this application was funded by 
http://www.sogrp.com
        * @link http://www.sogrp.com/
        */
@@ -39,6 +39,11 @@
                var $external_from_value;
                var $external_criteria_value;
                var $_criteria_built = False;
+
+               /**
+               * @var string $order_string the ORDER BY component of a SQL 
string
+               */
+               var $order_string = '';
                /*************************************************************\
                * Entity, class and general section                           *
                \*************************************************************/
@@ -367,7 +372,7 @@
                        $this->_criteria_built = False;
 
                        $sql = $this->set_order($sql);
-                       unset($this->order_string);
+                       $this->order_string = '';
                        $this->ldebug('SQL', array('SQL String' => $sql));
                        return $sql;
                }
@@ -864,11 +869,14 @@
                */
                function order($fields = array(), $type = 'ASC')
                {
+                       if ( count($fields) )
+                       {
                        foreach($fields as $field)
                        {
-                               $order_fields = implode(',',$fields);
+                                       $order_fields = implode(',', $fields);
+                               }
+                               $this->order_string .= " ORDER BY 
{$order_fields} {$type}";
                        }
-                       $this->order_string .= ' ORDER BY '. $order_fields . ' 
' .$type;
                }
 
                function inserts($datas)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]