本文整理汇总了PHP中Zend_Db_Table::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Table::__construct方法的具体用法?PHP Zend_Db_Table::__construct怎么用?PHP Zend_Db_Table::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Table
的用法示例。
在下文中一共展示了Zend_Db_Table::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($config = array())
{
$this->db = Zend_Registry::get('db_bacula');
$this->db_adapter = Zend_Registry::get('DB_ADAPTER');
$this->bacula_acl = new MyClass_BaculaAcl();
parent::__construct($config);
}
示例2: __construct
public function __construct($config = array())
{
$this->db = Zend_Registry::get('db_bacula');
$this->db_adapter = Zend_Registry::get('DB_ADAPTER');
$this->_hasher = new MyClass_PasswordHash();
parent::__construct($config);
}
示例3: __construct
public function __construct($config = array(), $definition = null)
{
parent::__construct($config, $definition);
$currentRoute = Modules_Router_Model_Router::getInstance()->current();
$this->_currentRouteId = $currentRoute['route_id'];
$this->_fetchBlocks();
}
示例4: __construct
/**
* Construtor padrão
*/
public function __construct($config = array(), $definition = null)
{
parent::__construct($config, $definition);
$this->_init();
$this->_translator = new Nidorx_Translator();
}
示例5: __construct
public function __construct($id = 0)
{
parent::__construct();
if (is_numeric($id) && $id > 0) {
$rowset = $this->find($id);
$this->row = $rowset[0];
}
}
示例6: __construct
public function __construct($config = array())
{
$this->db = Zend_Registry::get('db_bacula');
$this->db_adapter = Zend_Registry::get('DB_ADAPTER');
$config['db'] = $this->db;
$config['sequence'] = true;
parent::__construct($config);
}
示例7: __construct
/**
* Constructor
*
* @param array config
*/
public function __construct($config = array())
{
parent::__construct($config);
$db = $this->getAdapter();
$this->_left = $db->quoteIdentifier($this->_left);
$this->_right = $db->quoteIdentifier($this->_right);
$this->_level = $db->quoteIdentifier($this->_level);
}
示例8:
function __construct($config = null)
{
$dbAdapter = self::getDefaultAdapter();
if ($dbAdapter) {
$dbAdapter->query("SET NAMES 'utf8'");
}
return parent::__construct($config);
}
示例9: __construct
public function __construct($config = array())
{
global $application;
parent::__construct($config);
$resources = $application->getOption("resources");
if (isset($resources['db']['settings']['tableprefix'])) {
$this->_name = $resources['db']['settings']['tableprefix'] . $this->_name;
}
}
示例10: __construct
/**
* Constructor
*
* @param array $options = array()
* @return null
*/
public function __construct(array $options = array())
{
// ** Automatically setup the metadata cache ONLY if not set **
if (!isset($options['metadataCache'])) {
$options['metadataCache'] = Zend_Registry::get('cache');
}
// ** Continue normally **
parent::__construct($options);
}
示例11: __construct
public function __construct($config = array())
{
parent::__construct($config);
if (isset($config[self::USER])) {
$this->_user = $config[self::USER];
} elseif (Zend_Registry::isRegistered("shard")) {
$this->_user = Zend_Registry::get("shard");
}
}
示例12: __construct
public function __construct()
{
$dbconfig = new Zend_Config_Ini(CONFIGS_PATH . "/application.ini", 'production');
Zend_Registry::set('dbprefix', $dbconfig->resources->db->params->prefix);
$this->_dbprefix = $dbconfig->resources->db->params->prefix;
$dbprefix = Zend_Registry::get('dbprefix');
$this->_name = $dbprefix . $this->_name;
parent::__construct();
}
示例13: __construct
public function __construct($config = array(), $definition = null)
{
parent::__construct($config, $definition);
$config = Zend_Registry::get("__CONFIG__");
if (isset($config["page"]["limit"])) {
$this->limit = $config["page"]["limit"];
} else {
$this->limit = 20;
}
}
示例14: array
function Bolts_Db_Table_Abstract($config = null)
{
$this->_errors = array();
if (isset($this->_use_adapter)) {
$dbAdapters = Zend_Registry::get('dbAdapters');
$config = $dbAdapters[$this->_use_adapter];
}
$this->_Bolts_plugin = Bolts_Plugin::getInstance();
return parent::__construct($config);
}
示例15: __construct
/**
* @param string $prefix для формирования имен tmp таблиц
* @param string $jobidHash хэш-индекс для массива jobid
*/
public function __construct($jobidhash, $ttl_restore_session)
{
$this->db_adapter = Zend_Registry::get('DB_ADAPTER');
$this->jobidhash = $jobidhash;
$this->ttl_restore_session = $ttl_restore_session;
// формируем имена временных таблиц
$this->tmp_file = self::_PREFIX . 'file_' . $this->jobidhash;
$config['db'] = Zend_Registry::get('db_bacula');
// database
$config['name'] = $this->_name;
// name table
$config['primary'] = $this->_primary;
// primary key
$config['sequence'] = true;
parent::__construct($config);
// setup DB adapter
$this->_db = Zend_Db_Table::getAdapter('db_bacula');
// существует ли таблица ?
try {
$this->_db->query('SELECT tmpId FROM ' . $this->_name . ' LIMIT 1');
} catch (Zend_Exception $e) {
// создаем таблицу
switch ($this->db_adapter) {
case 'PDO_MYSQL':
$sql = 'CREATE TABLE ' . $this->_name . ' (
tmpId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
tmpName CHAR(64) UNIQUE NOT NULL,
tmpJobIdHash CHAR(64) NOT NULL,
tmpCreate TIMESTAMP NOT NULL,
tmpIsCloneOk INTEGER DEFAULT 0,
PRIMARY KEY(tmpId)
)';
break;
case 'PDO_PGSQL':
$sql = 'CREATE TABLE ' . $this->_name . ' (
tmpId SERIAL NOT NULL,
tmpName CHAR(64) UNIQUE NOT NULL,
tmpJobIdHash CHAR(64) NOT NULL,
tmpCreate timestamp without time zone NOT NULL,
tmpIsCloneOk SMALLINT DEFAULT 0,
PRIMARY KEY(tmpId))';
break;
case 'PDO_SQLITE':
$sql = 'CREATE TABLE ' . $this->_name . ' (
tmpId INTEGER,
tmpName CHAR(64) UNIQUE NOT NULL,
tmpJobIdHash CHAR(64) NOT NULL,
tmpCreate TIMESTAMP NOT NULL,
tmpIsCloneOk INTEGER DEFAULT 0,
PRIMARY KEY(tmpId))';
break;
}
$this->_db->query($sql);
}
}