本文整理匯總了PHP中Contract::notifyEach2Weeks5Times方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contract::notifyEach2Weeks5Times方法的具體用法?PHP Contract::notifyEach2Weeks5Times怎麽用?PHP Contract::notifyEach2Weeks5Times使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Contract
的用法示例。
在下文中一共展示了Contract::notifyEach2Weeks5Times方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: printStartDate
{
$this->contractMonths = $months;
}
public function printStartDate()
{
echo "Start Date is " . $this->contractDate->format('Y-m-d') . PHP_EOL;
}
public function printEndDate()
{
echo "End Date is " . $this->contractDate->getEndDate($this->contractMonths) . PHP_EOL;
}
public function notifyEach2Weeks5Times()
{
$interval = new DateInterval('P2W');
$period = new DatePeriod($this->contractDate, $interval, 5, DatePeriod::EXCLUDE_START_DATE);
foreach ($period as $nextDateTime) {
echo $nextDateTime->format('Y-m-d') . PHP_EOL;
}
}
}
echo "Contrato de 12 meses desde la fecha actual." . PHP_EOL;
$contract = new Contract(date("Y-m-d"), 12);
echo $contract->printStartDate();
echo $contract->printEndDate();
echo "Cambiamos los meses de contrato a 24." . PHP_EOL;
$contract->changeContractMonths(24);
echo $contract->printEndDate();
echo PHP_EOL;
echo "Recordatorio cada 2 semanas 5 veces:" . PHP_EOL;
$contract->notifyEach2Weeks5Times();