本文整理汇总了PHP中Zend_Date::subDayOfYear方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Date::subDayOfYear方法的具体用法?PHP Zend_Date::subDayOfYear怎么用?PHP Zend_Date::subDayOfYear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Date
的用法示例。
在下文中一共展示了Zend_Date::subDayOfYear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLoose
//.........这里部分代码省略.........
// success
}
try {
$date->addWeekday(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->subWeekday(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->compareWeekday(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->setDayOfYear(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->addDayOfYear(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->subDayOfYear(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->compareDayOfYear(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->setHour(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->addHour(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->subHour(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
// success
}
try {
$date->compareHour(null);
$this->fail();
} catch (Zend_Date_Exception $e) {
示例2: multiPaiementPackage
private function multiPaiementPackage(Package $package)
{
$montant = 0;
$montantPreleve = 0;
$i = 1;
$montantPanier = $this->montantTotal;
/* @var PrestationPanier $prestationPanier */
$aPaiement = array();
$aPaiementImmediat = array();
$dateValidePrecedent = null;
$garantiePrecedente = null;
$startPrestationPanier = $this->prestationsPanier;
$prestationPanier = $startPrestationPanier[0];
$debut = $prestationPanier->debut;
// foreach($this->prestationsPanier as $prestationPanier) {
foreach ($package->garantieDemandee as $oGarantie) {
if ($montantPanier == $montantPreleve) {
break;
}
$debutSejour = new \Zend_Date($debut);
$now = new \Zend_Date();
$now->set(00, \Zend_Date::HOUR);
$now->set(00, \Zend_Date::MINUTE);
$now->set(00, \Zend_Date::SECOND);
if ($oGarantie->condition == -1) {
$condition = 0;
} else {
$condition = $oGarantie->condition;
}
$dateValide = $debutSejour->subDayOfYear($condition);
if ($dateValide > $now) {
if ($i == 1) {
$dateValidePrecedent = $dateValide;
$garantiePrecedente = $oGarantie;
$dateValide = $now;
} elseif ($i == sizeof($package->garantieDemandee)) {
$dateValide = $debutSejour->subDayOfYear($garantiePrecedente->condition);
} else {
$dateValide = $dateValidePrecedent;
$dateValidePrecedent = $dateValide;
$garantiePrecedente = $oGarantie;
}
$i++;
if ($oGarantie->unite == "%") {
$montant = $montantPanier * ($oGarantie->valeur / 100) - $montantPreleve;
$montantPreleve += $montant;
}
if ($dateValide->toString("dd/MM/YYYY") == $now->toString("dd/MM/YYYY")) {
if (!isset($aPaiementImmediat[$dateValide->toString("dd/MM/YYYY")])) {
$aPaiementImmediat[$dateValide->toString("dd/MM/YYYY")] = $montant;
} else {
$aPaiementImmediat[$dateValide->toString("dd/MM/YYYY")] += $montant;
}
} else {
if (!isset($aPaiement[$dateValide->toString("dd/MM/YYYY")])) {
$aPaiement[$dateValide->toString("dd/MM/YYYY")] = $montant;
} else {
$aPaiement[$dateValide->toString("dd/MM/YYYY")] += $montant;
}
}
}
}
// }
foreach ($aPaiementImmediat as $dateValide => $montant) {
$paiement = new Paiement($montant, $dateValide);
$this->addPaiement($paiement);
}
foreach ($aPaiement as $dateValide => $montant) {
$paiement = new Paiement($montant, $dateValide);
$this->addPaiement($paiement);
}
return $this->_paiements;
}