本文整理匯總了PHP中Tinebase_DateTime::setHour方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_DateTime::setHour方法的具體用法?PHP Tinebase_DateTime::setHour怎麽用?PHP Tinebase_DateTime::setHour使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tinebase_DateTime
的用法示例。
在下文中一共展示了Tinebase_DateTime::setHour方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: appendFilterSql
/**
* appends sql to given select statement
*
* @param Zend_Db_Select $_select
* @param Tinebase_Backend_Sql_Abstract $_backend
*
* @todo to be removed once we split filter model / backend
*/
public function appendFilterSql($_select, $_backend)
{
$now = new Tinebase_DateTime();
$now->setHour(0)->setMinute(0)->setSecond(0);
$db = Tinebase_Core::getDb();
if ($this->_value == 1) {
$_select->where($db->quoteInto('(' . $db->quoteIdentifier('employment_end') . ' >= ? ', $now, 'datetime') . ' OR ' . $db->quoteIdentifier('employment_end') . ' IS NULL )');
$_select->where($db->quoteInto('( ' . $db->quoteIdentifier('employment_begin') . ' <= ? ', $now, 'datetime') . ' OR ( ' . $db->quoteIdentifier('employment_begin') . ' IS NULL ))');
} else {
$_select->where($db->quoteInto($db->quoteIdentifier('employment_end') . ' < ? ', $now, 'datetime'));
$_select->orWhere($db->quoteInto($db->quoteIdentifier('employment_begin') . ' > ? ', $now, 'datetime'));
}
}
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:21,代碼來源:EmployeeEmployedFilter.php
示例2: _createTimespanDataXML
/**
* Creates XML Data for a combobox
*
* Hours: 0 to 24
*
* @param string $default
* @return string
*/
protected function _createTimespanDataXML($start = 0, $end = 24)
{
$doc = new DomDocument('1.0');
$options = $doc->createElement('options');
$doc->appendChild($options);
$time = new Tinebase_DateTime('@0');
for ($i = $start; $i <= $end; $i++) {
$time->setHour($i);
$timeString = $time->format('H:i');
if ($i == $end && $timeString == '00:00') {
$timeString = '24:00';
}
$value = $doc->createElement('value');
$value->appendChild($doc->createTextNode($timeString));
$label = $doc->createElement('label');
$label->appendChild($doc->createTextNode($timeString));
// @todo l10n
$option = $doc->createElement('option');
$option->appendChild($value);
$option->appendChild($label);
$options->appendChild($option);
}
return $doc->saveXML();
}