本文整理汇总了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();
}