本文整理汇总了PHP中Nette\Utils\DateTime::modifyClone方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTime::modifyClone方法的具体用法?PHP DateTime::modifyClone怎么用?PHP DateTime::modifyClone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Utils\DateTime
的用法示例。
在下文中一共展示了DateTime::modifyClone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializePayment
/**
* Set specific payment properties
*
* @param Payment $payment
* @return void
*/
public function initializePayment(Payment $payment)
{
$payment->setMerchantReference('12345678');
$payment->setPaymentAmount(10000);
$today = new DateTime();
$shipDate = $today->modifyClone('+ 10 days');
$payment->setShipBeforeDate($shipDate);
$sessionValidity = $today->modifyClone('+ 30 minutes');
$payment->setSessionValidity($sessionValidity);
}
示例2: generate
/**
* Generate table
*/
protected function generate()
{
$openingHours = $this->openingHours;
$days = $this->getRelativeDays();
$table = new Table\Sheet();
foreach ($days as $day) {
$line = new Table\Line();
if ($day === 0) {
$line->setActive();
}
$now = new DateTime();
$dayOpeningHours = $openingHours->getDay($day === 0 ? $now : $now->modifyClone(($day > 0 ? '+' : '-') . $day . ' days'));
$timeFrom = (new FilterTime\Def($dayOpeningHours->getOpenTime()))->getOutput();
$timeTo = (new FilterTime\Def($dayOpeningHours->getCloseTime()))->getOutput();
foreach ($this->timeFilters as $filter) {
$timeFromFormatted = (new $filter($timeFrom))->getOutput();
$timeToFormatted = (new $filter($timeTo))->getOutput();
}
$line->setTitle($day);
$line->setTimeFrom($timeFrom);
$line->setTimeFromFormatted($timeFromFormatted);
$line->setTimeTo($timeTo);
$line->setTimeToFormatted($timeToFormatted);
$line->tags = $dayOpeningHours->tags;
if ($dayOpeningHours instanceof \Cothema\OpeningHours\Model\SpecificDay) {
$line->specific = TRUE;
}
$table->addLine($line);
}
$this->generatedTable = $table;
}
示例3: createComponentFaktura
protected function createComponentFaktura()
{
$dateNow = new DateTime();
$variableSymbol = 123;
$supplierBuilder = new ParticipantBuilder("company", "Street", '', "City", "Postcode");
$supplier = $supplierBuilder->setIn(1111)->setTin("CZ1111")->setAccountNumber("123/0800")->build();
$nazev = "Customer Name";
$customerBuilder = new ParticipantBuilder($nazev, "Customer street", '', "Customer city", "Postcode");
$customer = $customerBuilder->build();
$items = array(new ItemImpl('Sample item', 1, 1111, TaxImpl::fromPercent(22), false));
$dataBuilder = new DataBuilder(999, 'Faktura', $supplier, $customer, $dateNow->modifyClone("+14 days"), $dateNow, $items);
$dataBuilder->setVariableSymbol($variableSymbol)->setDateOfVatRevenueRecognition($dateNow->modifyClone("+15 days"));
$data = $dataBuilder->build();
$env = new Eciovni($data);
$env->setTemplatePath(__DIR__ . "/templates/faktura.latte");
return $env;
}