Example #1
0
 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);
 }
Example #2
0
 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);
 }
Example #3
0
 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();
 }
Example #4
0
    /**
     * Construtor padrão
     */
    public function __construct($config = array(), $definition = null)
    {
        parent::__construct($config, $definition);
        $this->_init();

        $this->_translator = new Nidorx_Translator();
    }
Example #5
0
 public function __construct($id = 0)
 {
     parent::__construct();
     if (is_numeric($id) && $id > 0) {
         $rowset = $this->find($id);
         $this->row = $rowset[0];
     }
 }
 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);
 }
Example #7
0
 /**
  * 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);
 }
 function __construct($config = null)
 {
     $dbAdapter = self::getDefaultAdapter();
     if ($dbAdapter) {
         $dbAdapter->query("SET NAMES 'utf8'");
     }
     return parent::__construct($config);
 }
Example #9
0
 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;
     }
 }
Example #10
0
 /**
  * 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);
 }
Example #11
0
 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");
     }
 }
Example #12
0
 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();
 }
Example #13
0
 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;
     }
 }
Example #14
0
 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);
 }
 /**
  * @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);
     }
 }
Example #16
0
	function RivetyCore_Db_Table_Abstract($config = null)
	{
		$this->_errors = array();
		if (isset($this->_use_adapter))
		{
			$dbAdapters = Zend_Registry::get('dbAdapters');
			$config = ($dbAdapters[$this->_use_adapter]);
		}
		$this->_rivety_plugin = RivetyCore_Plugin::getInstance();
		return parent::__construct($config);
	}
Example #17
0
 public function __construct($aConfig = array(), $aAttrs = array())
 {
     $this->_checkAttibutes($aAttrs);
     $oRegistry = Zend_Registry::getInstance();
     $this->_oConfig = $oRegistry->get(REGISTRY_CONFIG);
     $this->_setTableName();
     parent::__construct($aConfig);
     if (self::$_bUtf8 == false) {
         $this->getAdapter()->query('SET NAMES utf8');
         self::$_bUtf8 = true;
     }
 }
Example #18
0
 public function __construct()
 {
     global $application;
     $prefix = $application->getOption('tablePrefix');
     if (!empty($prefix)) {
         $this->_name = $prefix . $this->_name;
     }
     // cache the meta data for tables so it doesn't have to get it ever time a table is instantiated
     if (Zend_Registry::isRegistered('cache')) {
         $cache = Zend_Registry::get('cache');
         Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
     }
     parent::__construct();
 }
Example #19
0
 /**
  * Initialize a single user object
  *
  * @param int $id The id of the user we wish to retrieve.
  * @param array $data Skip the database query and instead populate the object with this data.
  *
  * @throws Exception
  * @return Model_DbTable_User
  */
 public function __construct($id = null, $data = array())
 {
     parent::__construct();
     if ($id != null) {
         if (count($data) > 0) {
             $this->initUser($data);
         } else {
             $id = (int) $id;
             try {
                 $user = $this->fetchRow('id = ' . $id)->toArray();
             } catch (Exception $e) {
                 throw new Exception('Count not find user ' . $id . '.');
             }
             $this->initUser($user);
         }
     }
 }
Example #20
0
 public function __construct($siteId)
 {
     $dbAdapter = Zend_Registry::get('dbAdapter');
     $select = $dbAdapter->select();
     $select->from('sites', array('s_dbname'));
     $select->where('s_id = ?', $siteId);
     $this->siteDbName = $dbAdapter->fetchOne($select->__toString());
     $config = Zend_Registry::get('config');
     $params = $config->db->config->toArray();
     $params['dbname'] = $this->siteDbName;
     $this->siteDbAdapter = Zend_Db::factory($config->db->adapter, $params);
     $this->siteDbAdapter->query('SET NAMES utf8');
     $this->siteId = $siteId;
     parent::__construct(array(Zend_Db_Table::ADAPTER => $this->siteDbAdapter, Zend_Db_Table::NAME => $this->tablename));
     $info = $this->info();
     //		var_dump($info);
     $this->pkname = array_shift($info[Zend_Db_Table::PRIMARY]);
     $this->createAttributesList();
     $this->recPerPage = $config->pager->rec_per_page;
     $this->pagerLinks = $config->pager->pager_links;
 }
Example #21
0
 public function __construct($tablePrefix)
 {
     $this->_name = $tablePrefix . $this->_name;
     $this->_tablePrefix = $tablePrefix;
     parent::__construct();
 }
Example #22
0
 public function __construct()
 {
     $db = new Conexao(Zend_Registry::get('DIR_CONFIG'), "conexao_sac");
     parent::__construct();
 }
Example #23
0
 public function __construct($config = array(), $definition = null)
 {
     parent::__construct($config, $definition);
     $this->_modelItems = new Zend_Db_Table($this->_nameItemsModel);
 }
Example #24
0
 public function __construct($config = array(), $definition = null)
 {
     parent::__construct($config, $definition);
     $this->_acceptedRoles = array_keys(Zetta_Acl::getInstance()->getAccepdedRolesHash());
 }
Example #25
0
 public function __construct($config = array())
 {
     $this->db = Zend_Registry::get('db_bacula');
     parent::__construct($config);
 }
 public function __construct($name, $primary)
 {
     $this->_name = $name;
     $this->_primary = $primary;
     parent::__construct();
 }
Example #27
0
 public function __construct($config = array(), $definition = null)
 {
     parent::__construct($config, $definition);
     $this->_buildRoutesTree();
     Zend_Registry::set('router', $this);
 }
Example #28
0
 /**
  * __construct() - For concrete implementation of Conjoon_Db_Table
  *
  * This constructor automatically prepends the prefix as defined using setTablePrefix()
  * to this table's name.
  *
  * @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)
 {
     $this->_name = self::getTablePrefix() . $this->_name;
     parent::__construct($config, $definition);
 }
Example #29
0
 public function __construct($config = array(), $definition = null)
 {
     $this->_init();
     parent::__construct($config, $definition);
 }