本文整理汇总了PHP中Tinebase_Backend_Sql_Abstract::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Backend_Sql_Abstract::__construct方法的具体用法?PHP Tinebase_Backend_Sql_Abstract::__construct怎么用?PHP Tinebase_Backend_Sql_Abstract::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Backend_Sql_Abstract
的用法示例。
在下文中一共展示了Tinebase_Backend_Sql_Abstract::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
}
示例2: __construct
/**
* 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') . ')'));
}
示例3: __construct
/**
* 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'))) . ')');
}
}
示例4: __construct
/**
* 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];
}
}
示例5: __construct
/**
* (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));
}
示例6: __construct
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));
}
示例7: __construct
/**
* 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);
}
示例8: __construct
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();
}
示例9: __construct
/**
* 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'))) . ')');
}
示例10: __construct
/**
* (non-PHPdoc)
* @see Tinebase_Backend_Sql_Abstract::__construct()
*/
public function __construct($_dbAdapter = NULL, $_options = array())
{
parent::__construct($_dbAdapter, $_options);
}