/** * the constructor * * @param Zend_Db_Adapter_Abstract $_db (optional) * @param array $_options (optional) */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); // set default adapter $config = Tinebase_Core::getConfig(); $adapter = $config->{Tinebase_Auth_CredentialCache_Adapter_Config::CONFIG_KEY} ? 'Config' : 'Cookie'; $this->setCacheAdapter($adapter); }
/** * the constructor * * allowed options: * - modelName * - tableName * - tablePrefix * - modlogActive * * @param Zend_Db_Adapter_Abstract $_db (optional) * @param array $_options (optional) * @throws Tinebase_Exception_Backend_Database */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); $this->_additionalSearchCountCols = array('is_billable_combined' => null, 'duration' => 'duration', 'duration_billable' => null); $this->_foreignTables['is_billable_combined']['select'] = array('is_billable_combined' => new Zend_Db_Expr('(' . $this->_db->quoteIdentifier('timetracker_timesheet.is_billable') . '*' . $this->_db->quoteIdentifier('timetracker_timeaccount.is_billable') . ')')); $this->_foreignTables['is_cleared_combined']['select'] = array('is_cleared_combined' => new Zend_Db_Expr('(CASE WHEN ' . $this->_db->quoteIdentifier('timetracker_timesheet.is_cleared') . " = '1' OR " . $this->_db->quoteIdentifier('timetracker_timeaccount.status') . " = 'billed' THEN 1 ELSE 0 END)")); $this->_foreignTables['duration_billable']['select'] = array('duration_billable' => new Zend_Db_Expr('(' . $this->_db->quoteIdentifier('duration') . '*' . $this->_db->quoteIdentifier('timetracker_timesheet.is_billable') . '*' . $this->_db->quoteIdentifier('timetracker_timeaccount.is_billable') . ')')); }
/** * the constructor * * allowed options: * - modelName * - tableName * - tablePrefix * - modlogActive * * @param Zend_Db_Adapter_Abstract $_dbAdapter (optional) * @param array $_options (optional) * @throws Tinebase_Exception_Backend_Database */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); /** * TODO move this code somewhere and make it optionally. Maybe even make it a new controller / frontend action and request the data async */ if (Addressbook_Config::getInstance()->featureEnabled(Addressbook_Config::FEATURE_LIST_VIEW)) { $this->_additionalColumns['emails'] = new Zend_Db_Expr('(' . $this->_db->select()->from($this->_tablePrefix . 'addressbook', array($this->_dbCommand->getAggregate('email')))->where($this->_db->quoteIdentifier('id') . ' IN ?', $this->_db->select()->from(array('addressbook_list_members' => $this->_tablePrefix . 'addressbook_list_members'), array('contact_id'))->where($this->_db->quoteIdentifier('addressbook_list_members.list_id') . ' = ' . $this->_db->quoteIdentifier('addressbook_lists.id'))) . ')'); } }
/** * the constructor * * allowed numberableConfiguration: * - tablename (req) * - numberablecolumn (req) * - stepsize (optional) * - bucketcolumn (optional) * - bucketkey (optional) * * * allowed options: * see parent class * * @param array $_numberableConfiguration * @param Zend_Db_Adapter_Abstract $_db (optional) * @param array $_options (optional) * @throws Tinebase_Exception_Backend_Database */ public function __construct($_numberableConfiguration, $_dbAdapter = NULL, $_options = array()) { if (!isset($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_TABLENAME])) { throw new Tinebase_Exception_UnexpectedValue(__CLASS__ . ' is missing "' . Tinebase_Numberable_Abstract::CONF_TABLENAME . '" configuration.'); } $this->_tableName = $_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_TABLENAME]; if (!isset($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_NUMCOLUMN])) { throw new Tinebase_Exception_UnexpectedValue(__CLASS__ . ' is missing "' . Tinebase_Numberable_Abstract::CONF_NUMCOLUMN . '" configuration.'); } $this->_numberableColumn = $_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_NUMCOLUMN]; parent::__construct($_dbAdapter, $_options); if (isset($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_STEPSIZE])) { if (!is_int($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_STEPSIZE])) { throw new Tinebase_Exception_UnexpectedValue(__CLASS__ . ' found improper "' . Tinebase_Numberable_Abstract::CONF_STEPSIZE . '" configuration: (not a int) "' . $_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_STEPSIZE] . '"'); } $this->_stepSize = intval($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_STEPSIZE]); } if (isset($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_BUCKETCOLUMN])) { $this->_bucketColumn = $_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_BUCKETCOLUMN]; } if (isset($_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_BUCKETKEY])) { $this->_bucketKey = $_numberableConfiguration[Tinebase_Numberable_Abstract::CONF_BUCKETKEY]; } }
/** * (non-PHPdoc) * @see Tinebase_Backend_Sql_Abstract::__construct() */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); $this->_foreignTables['jpegphoto']['select'] = array('jpegphoto' => $this->_dbCommand->getIfIsNull('addressbook_image.contact_id', 0, 1)); }
public function __construct($_dbAdapter = null, array $_options = array()) { parent::__construct($_dbAdapter, $_options); $this->_foreignTables['jpegphoto']['select'] = array('jpegphoto' => Tinebase_Backend_Sql_Command::getIfIsNull($this->_db, $this->_db->quoteIdentifier('addressbook_image.contact_id'), 0, 1)); }
/** * the constructor * * @param Zend_Db_Adapter_Abstract $_db optional * @param array $_options (optional) */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); $this->_attendeeBackend = new Calendar_Backend_Sql_Attendee($_dbAdapter); }
public function __construct($_dbAdapter = NULL, $_modelName = NULL, $_tableName = NULL, $_tablePrefix = NULL, $_modlogActive = NULL, $_useSubselectForCount = NULL) { parent::__construct($_dbAdapter, $_modelName, $_tableName, $_tablePrefix, $_modlogActive, $_useSubselectForCount); $this->opBackend = new Billing_Backend_OrderPosition(); }
/** * the constructor * * allowed options: * - modelName * - tableName * - tablePrefix * - modlogActive * * @param Zend_Db_Adapter_Abstract $_db (optional) * @param array $_options (optional) * @throws Tinebase_Exception_Backend_Database */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); $this->_additionalColumns['emails'] = new Zend_Db_Expr('(' . $this->_db->select()->from($this->_tablePrefix . 'addressbook', array($this->_dbCommand->getAggregate('email')))->where($this->_db->quoteIdentifier('id') . ' IN ?', $this->_db->select()->from(array('addressbook_list_members' => $this->_tablePrefix . 'addressbook_list_members'), array('contact_id'))->where($this->_db->quoteIdentifier('addressbook_list_members.list_id') . ' = ' . $this->_db->quoteIdentifier('addressbook_lists.id'))) . ')'); }
/** * (non-PHPdoc) * @see Tinebase_Backend_Sql_Abstract::__construct() */ public function __construct($_dbAdapter = NULL, $_options = array()) { parent::__construct($_dbAdapter, $_options); }