[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/dbal/src/drivers/sqlite/ -> lmbSqliteManipulationStatement.class.php (source)

   1  <?php
   2  /*

   3   * Limb PHP Framework

   4   *

   5   * @link http://limb-project.com

   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)

   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html

   8   */
   9  
  10  lmb_require('limb/dbal/src/drivers/lmbDbManipulationStatement.interface.php');
  11  lmb_require(dirname(__FILE__) . '/lmbSqliteStatement.class.php');
  12  
  13  /**

  14   * class lmbSqliteManipulationStatement.

  15   *

  16   * @package dbal

  17   * @version $Id$

  18   */
  19  class lmbSqliteManipulationStatement extends lmbSqliteStatement implements lmbDbManipulationStatement
  20  {
  21    function getAffectedRowCount()
  22    {
  23      return sqlite_changes($this->connection->getConnectionId());
  24    }
  25  
  26    function execute()
  27    {
  28      $sql = ltrim($this->getSQL());
  29  
  30      //this is a dirty hack for sqlite_changes which

  31      //doesn't return proper value if there was not

  32      if((stripos($sql, 'delete ') === 0 || stripos($sql, 'update '))
  33         && stripos($sql, ' where ') === false)
  34        $sql .= " WHERE 1=1";
  35  
  36      return (bool)$this->connection->execute($sql);
  37    }
  38  }
  39  
  40  ?>


Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7