2019-07-17 20:08:50 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Zend Framework
|
|
|
|
*
|
|
|
|
* LICENSE
|
|
|
|
*
|
|
|
|
* This source file is subject to the new BSD license that is bundled
|
|
|
|
* with this package in the file LICENSE.txt.
|
|
|
|
* It is also available through the world-wide-web at this URL:
|
|
|
|
* http://framework.zend.com/license/new-bsd
|
|
|
|
* If you did not receive a copy of the license and are unable to
|
|
|
|
* obtain it through the world-wide-web, please send an email
|
|
|
|
* to license@zend.com so we can send you a copy immediately.
|
|
|
|
*
|
|
|
|
* @category Zend
|
|
|
|
* @package Zend_Db
|
|
|
|
* @subpackage Table
|
2019-07-17 20:19:00 +00:00
|
|
|
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
2019-07-17 20:08:50 +00:00
|
|
|
* @license http://framework.zend.com/license/new-bsd New BSD License
|
2019-07-17 20:19:00 +00:00
|
|
|
* @version $Id: Table.php 16733 2009-07-15 13:16:50Z ralph $
|
2019-07-17 20:08:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Zend_Db_Table_Abstract
|
|
|
|
*/
|
|
|
|
require_once 'Zend/Db/Table/Abstract.php';
|
|
|
|
|
2019-07-17 20:19:00 +00:00
|
|
|
/**
|
|
|
|
* @see Zend_Db_Table_Definition
|
|
|
|
*/
|
|
|
|
require_once 'Zend/Db/Table/Definition.php';
|
|
|
|
|
2019-07-17 20:08:50 +00:00
|
|
|
/**
|
|
|
|
* Class for SQL table interface.
|
|
|
|
*
|
|
|
|
* @category Zend
|
|
|
|
* @package Zend_Db
|
|
|
|
* @subpackage Table
|
2019-07-17 20:19:00 +00:00
|
|
|
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
2019-07-17 20:08:50 +00:00
|
|
|
* @license http://framework.zend.com/license/new-bsd New BSD License
|
|
|
|
*/
|
2019-07-17 20:19:00 +00:00
|
|
|
class Zend_Db_Table extends Zend_Db_Table_Abstract
|
2019-07-17 20:08:50 +00:00
|
|
|
{
|
2019-07-17 20:19:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* __construct() - For concrete implementation of Zend_Db_Table
|
|
|
|
*
|
|
|
|
* @param string|array $config string can reference a Zend_Registry key for a db adapter
|
|
|
|
* OR it can refernece the name of a table
|
|
|
|
* @param unknown_type $definition
|
|
|
|
*/
|
|
|
|
public function __construct($config = array(), $definition = null)
|
|
|
|
{
|
|
|
|
if ($definition !== null && is_array($definition)) {
|
|
|
|
$definition = new Zend_Db_Table_Definition($definition);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_string($config)) {
|
|
|
|
if (Zend_Registry::isRegistered($config)) {
|
|
|
|
trigger_error(__CLASS__ . '::' . __METHOD__ . '(\'registryName\') is not valid usage of Zend_Db_Table, '
|
|
|
|
. 'try extending Zend_Db_Table_Abstract in your extending classes.',
|
|
|
|
E_USER_NOTICE
|
|
|
|
);
|
|
|
|
$config = array(self::ADAPTER => $config);
|
|
|
|
} else {
|
|
|
|
// process this as table with or without a definition
|
|
|
|
if ($definition instanceof Zend_Db_Table_Definition
|
|
|
|
&& $definition->hasTableConfig($config)) {
|
|
|
|
// this will have DEFINITION_CONFIG_NAME & DEFINITION
|
|
|
|
$config = $definition->getTableConfig($config);
|
|
|
|
} else {
|
|
|
|
$config = array(self::NAME => $config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
parent::__construct($config);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-17 20:08:50 +00:00
|
|
|
}
|