web/lib/Zend/Db/Adapter/Abstract.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Db
    16  * @package    Zend_Db
    17  * @subpackage Adapter
    17  * @subpackage Adapter
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Abstract.php 23252 2010-10-26 12:48:32Z matthew $
    20  * @version    $Id: Abstract.php 25229 2013-01-18 08:17:21Z frosch $
    21  */
    21  */
    22 
    22 
    23 
    23 
    24 /**
    24 /**
    25  * @see Zend_Db
    25  * @see Zend_Db
    35  * Class for connecting to SQL databases and performing common operations.
    35  * Class for connecting to SQL databases and performing common operations.
    36  *
    36  *
    37  * @category   Zend
    37  * @category   Zend
    38  * @package    Zend_Db
    38  * @package    Zend_Db
    39  * @subpackage Adapter
    39  * @subpackage Adapter
    40  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    40  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    41  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    41  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    42  */
    42  */
    43 abstract class Zend_Db_Adapter_Abstract
    43 abstract class Zend_Db_Adapter_Abstract
    44 {
    44 {
    45 
    45 
   154      *
   154      *
   155      * port           => (string) The port of the database
   155      * port           => (string) The port of the database
   156      * persistent     => (boolean) Whether to use a persistent connection or not, defaults to false
   156      * persistent     => (boolean) Whether to use a persistent connection or not, defaults to false
   157      * protocol       => (string) The network protocol, defaults to TCPIP
   157      * protocol       => (string) The network protocol, defaults to TCPIP
   158      * caseFolding    => (int) style of case-alteration used for identifiers
   158      * caseFolding    => (int) style of case-alteration used for identifiers
       
   159      * socket         => (string) The socket or named pipe that should be used
   159      *
   160      *
   160      * @param  array|Zend_Config $config An array or instance of Zend_Config having configuration data
   161      * @param  array|Zend_Config $config An array or instance of Zend_Config having configuration data
   161      * @throws Zend_Db_Adapter_Exception
   162      * @throws Zend_Db_Adapter_Exception
   162      */
   163      */
   163     public function __construct($config)
   164     public function __construct($config)
   529      * Inserts a table row with specified data.
   530      * Inserts a table row with specified data.
   530      *
   531      *
   531      * @param mixed $table The table to insert data into.
   532      * @param mixed $table The table to insert data into.
   532      * @param array $bind Column-value pairs.
   533      * @param array $bind Column-value pairs.
   533      * @return int The number of affected rows.
   534      * @return int The number of affected rows.
       
   535      * @throws Zend_Db_Adapter_Exception
   534      */
   536      */
   535     public function insert($table, array $bind)
   537     public function insert($table, array $bind)
   536     {
   538     {
   537         // extract and quote col names from the array keys
   539         // extract and quote col names from the array keys
   538         $cols = array();
   540         $cols = array();
   581      *
   583      *
   582      * @param  mixed        $table The table to update.
   584      * @param  mixed        $table The table to update.
   583      * @param  array        $bind  Column-value pairs.
   585      * @param  array        $bind  Column-value pairs.
   584      * @param  mixed        $where UPDATE WHERE clause(s).
   586      * @param  mixed        $where UPDATE WHERE clause(s).
   585      * @return int          The number of affected rows.
   587      * @return int          The number of affected rows.
       
   588      * @throws Zend_Db_Adapter_Exception
   586      */
   589      */
   587     public function update($table, array $bind, $where = '')
   590     public function update($table, array $bind, $where = '')
   588     {
   591     {
   589         /**
   592         /**
   590          * Build "col = ?" pairs for the statement,
   593          * Build "col = ?" pairs for the statement,
   741      * Uses the current fetchMode for the adapter.
   744      * Uses the current fetchMode for the adapter.
   742      *
   745      *
   743      * @param string|Zend_Db_Select $sql An SQL SELECT statement.
   746      * @param string|Zend_Db_Select $sql An SQL SELECT statement.
   744      * @param mixed $bind Data to bind into SELECT placeholders.
   747      * @param mixed $bind Data to bind into SELECT placeholders.
   745      * @param mixed                 $fetchMode Override current fetch mode.
   748      * @param mixed                 $fetchMode Override current fetch mode.
   746      * @return array
   749      * @return mixed Array, object, or scalar depending on fetch mode.
   747      */
   750      */
   748     public function fetchRow($sql, $bind = array(), $fetchMode = null)
   751     public function fetchRow($sql, $bind = array(), $fetchMode = null)
   749     {
   752     {
   750         if ($fetchMode === null) {
   753         if ($fetchMode === null) {
   751             $fetchMode = $this->_fetchMode;
   754             $fetchMode = $this->_fetchMode;