當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。