當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Db_Table::__construct方法代碼示例

本文整理匯總了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);
 }
開發者ID:staser,項目名稱:webacula,代碼行數:7,代碼來源:Client.php

示例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);
 }
開發者ID:staser,項目名稱:webacula,代碼行數:7,代碼來源:Wbusers.php

示例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();
 }
開發者ID:kytvi2p,項目名稱:ZettaFramework,代碼行數:7,代碼來源:Blocks.php

示例4: __construct

    /**
     * Construtor padrão
     */
    public function __construct($config = array(), $definition = null)
    {
        parent::__construct($config, $definition);
        $this->_init();

        $this->_translator = new Nidorx_Translator();
    }
開發者ID:nidorx,項目名稱:Zend_Dao_Vo,代碼行數:10,代碼來源:Dao.php

示例5: __construct

 public function __construct($id = 0)
 {
     parent::__construct();
     if (is_numeric($id) && $id > 0) {
         $rowset = $this->find($id);
         $this->row = $rowset[0];
     }
 }
開發者ID:Cryde,項目名稱:sydney-core,代碼行數:8,代碼來源:Table.php

示例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);
 }
開發者ID:neverstoplwy,項目名稱:contrib-webacula,代碼行數:8,代碼來源:Wblogbook.php

示例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);
 }
開發者ID:BGCX262,項目名稱:zx-zf-hg-to-git,代碼行數:13,代碼來源:Nestedset.php

示例8:

 function __construct($config = null)
 {
     $dbAdapter = self::getDefaultAdapter();
     if ($dbAdapter) {
         $dbAdapter->query("SET NAMES 'utf8'");
     }
     return parent::__construct($config);
 }
開發者ID:BGCX261,項目名稱:zillatek-project-svn-to-git,代碼行數:8,代碼來源:DB.php

示例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;
     }
 }
開發者ID:Zerone,項目名稱:ImJob.org,代碼行數:9,代碼來源:Roles.php

示例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);
 }
開發者ID:blerby,項目名稱:blerby,代碼行數:15,代碼來源:Table.php

示例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");
     }
 }
開發者ID:kreativmind,項目名稱:storytlr,代碼行數:9,代碼來源:Table.php

示例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();
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:9,代碼來源:Db.php

示例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;
     }
 }
開發者ID:tudorfis,項目名稱:urfx,代碼行數:10,代碼來源:Abstract.php

示例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);
 }
開發者ID:jaybill,項目名稱:Bolts,代碼行數:10,代碼來源:Abstract.php

示例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);
     }
 }
開發者ID:neverstoplwy,項目名稱:contrib-webacula,代碼行數:59,代碼來源:WbTmpTable.php


注:本文中的Zend_Db_Table::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。