diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:39 +0000 |
commit | 8ca6cc32b2c789a3149861159ad258f2cb9491e3 (patch) | |
tree | 2492de6f1528dd44eaa169a5c1555026d9cb75ec /library/vendor/Zend/Db/Table.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-a598b28402ead15d3701df32e198513e7b1f299c.tar.xz icingaweb2-a598b28402ead15d3701df32e198513e7b1f299c.zip |
Adding upstream version 2.11.4.upstream/2.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | library/vendor/Zend/Db/Table.php | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/library/vendor/Zend/Db/Table.php b/library/vendor/Zend/Db/Table.php new file mode 100644 index 0000000..0dbfe8c --- /dev/null +++ b/library/vendor/Zend/Db/Table.php @@ -0,0 +1,77 @@ +<?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 + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ + */ + +/** + * @see Zend_Db_Table_Abstract + */ + +/** + * @see Zend_Db_Table_Definition + */ + +/** + * Class for SQL table interface. + * + * @category Zend + * @package Zend_Db + * @subpackage Table + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Db_Table extends Zend_Db_Table_Abstract +{ + + /** + * __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 reference the name of a table + * @param array|Zend_Db_Table_Definition $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); + } +} |