当前位置: 首页>>代码示例>>PHP>>正文


PHP DateTime::modifyClone方法代码示例

本文整理汇总了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);
 }
开发者ID:metisfw,项目名称:adyen,代码行数:16,代码来源:DummyPaymentOperation.php

示例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;
 }
开发者ID:cothema,项目名称:opening-hours,代码行数:34,代码来源:RelativeDays.php

示例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;
 }
开发者ID:chapcz,项目名称:sandbox,代码行数:17,代码来源:HomepagePresenter.php


注:本文中的Nette\Utils\DateTime::modifyClone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。