[limb-svn] r6059 - in 3.x/trunk/limb/dbal: src tests/cases/non-driver

svn at limb-project.com svn at limb-project.com
Tue Jul 3 15:38:15 MSD 2007


Author: serega
Date: 2007-07-03 15:38:15 +0400 (Tue, 03 Jul 2007)
New Revision: 6059
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6059

Modified:
   3.x/trunk/limb/dbal/src/lmbSimpleDb.class.php
   3.x/trunk/limb/dbal/tests/cases/non-driver/lmbSimpleDbTest.class.php
Log:
-- lmbSimpleDb :: selectAsArray() removed. Consider using lmbCollection :: toFlatArray($iterator, $key_field)

Modified: 3.x/trunk/limb/dbal/src/lmbSimpleDb.class.php
===================================================================
--- 3.x/trunk/limb/dbal/src/lmbSimpleDb.class.php	2007-07-03 11:35:41 UTC (rev 6058)
+++ 3.x/trunk/limb/dbal/src/lmbSimpleDb.class.php	2007-07-03 11:38:15 UTC (rev 6059)
@@ -56,16 +56,11 @@
   function selectRecord($table, $criteria = null, $order = array())
   {
     $rs = $this->select($table, $criteria, $order)->paginate(0, 1);
+    $rs->rewind();
     if($rs->valid())
       return $rs->current();
   }
 
-  function selectAsArray($table, $criteria = null, $order = array(), $key_field = '')
-  {
-    $rs = $this->select($table, $criteria, $order);
-    return $rs->getArray($key_field);
-  }
-
   /**
    * @deprecated
    */

Modified: 3.x/trunk/limb/dbal/tests/cases/non-driver/lmbSimpleDbTest.class.php
===================================================================
--- 3.x/trunk/limb/dbal/tests/cases/non-driver/lmbSimpleDbTest.class.php	2007-07-03 11:35:41 UTC (rev 6058)
+++ 3.x/trunk/limb/dbal/tests/cases/non-driver/lmbSimpleDbTest.class.php	2007-07-03 11:38:15 UTC (rev 6059)
@@ -116,33 +116,10 @@
     $this->assertEqual($record->get('title'), 'wow2');
   }
 
-  function testSelectAll()
-  {
-    $data = array(
-      0 => array('title' =>  'wow', 'description' => 'description'),
-      1 => array('title' =>  'wow', 'description' => 'description2')
-    );
-
-    $this->db->insert('test_db_table', $data[0]);
-    $this->db->insert('test_db_table', $data[1]);
-
-    $result = $this->db->select('test_db_table');
-
-    $this->assertEqual($result->count(), 2);
-
-    $result->rewind();
-    $record = $result->current();
-    $this->assertEqual($record->get('description'), 'description');
-
-    $result->next();
-    $record = $result->current();
-    $this->assertEqual($record->get('description'), 'description2');
-  }
-
   function testSelectWithOrder()
   {
     $data = array(
-      0 => array('title' =>  'aaa', 'description' => 'description'),
+      0 => array('title' =>  'aaa', 'description' => 'description1'),
       1 => array('title' =>  'zzz', 'description' => 'description2'),
       2 => array('title' =>  'kkk', 'description' => 'description3')
     );
@@ -160,7 +137,7 @@
   function testDeleteAll()
   {
     $data = array(
-      0 => array('title' =>  'wow', 'description' => 'description'),
+      0 => array('title' =>  'wow', 'description' => 'description1'),
       1 => array('title' =>  'wow!', 'description' => 'description2')
     );
 



More information about the limb-svn mailing list