本文整理汇总了PHP中PropelCollection::isLast方法的典型用法代码示例。如果您正苦于以下问题:PHP PropelCollection::isLast方法的具体用法?PHP PropelCollection::isLast怎么用?PHP PropelCollection::isLast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropelCollection
的用法示例。
在下文中一共展示了PropelCollection::isLast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDescription
/**
*
* Renvoi une description intelligible du traitement
*
* @return String description
*
*/
public function getDescription() {
if (!isset($description) || $description === null) {
$desc = 'n° '.$this->getId();
$desc .= ' créé le ';
$desc .= strftime("%a %d/%m/%Y", $this->getUpdatedAt('U'));
$eleve_col = new PropelCollection();
foreach ($this->getAbsenceEleveSaisies() as $abs_saisie) {
if ($abs_saisie->getEleve() != null) {
$eleve_col->add($abs_saisie->getEleve());
}
}
foreach ($eleve_col as $eleve) {
if ($eleve_col->isFirst()) {
$desc .= '; ';
}
$desc .= $eleve->getNom().' '.$eleve->getPrenom();
if (!$eleve_col->isLast()) {
$desc .= ', ';
}
}
if ($this->getAbsenceEleveType() != null) {
$desc .= "; type : ".$this->getAbsenceEleveType()->getNom();
}
if ($this->getAbsenceEleveMotif() != null) {
$desc .= "; motif : ".$this->getAbsenceEleveMotif()->getNom();
}
if ($this->getAbsenceEleveJustification() != null) {
$desc .= "; justification : ".$this->getAbsenceEleveJustification()->getNom();
}
$notif = false;
foreach ($this->getAbsenceEleveNotifications() as $notification) {
if ($notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_SUCCES
|| $notification->getStatutEnvoi() == AbsenceEleveNotificationPeer::STATUT_ENVOI_SUCCES_AVEC_ACCUSE_DE_RECEPTION) {
$notif = true;
break;
}
}
if ($notif) {
$desc .= "; Notifié";
}
if ($this->getCommentaire() != null && $this->getCommentaire() != '') {
$desc .= "; Commentaire : ".$this->getCommentaire();
}
$description = $desc;
}
return $description;
}
示例2: testIsLAst
public function testIsLAst()
{
$col = new PropelCollection();
$this->assertTrue($col->isLast(), 'isLast() returns true on an empty collection');
$data = array('bar1', 'bar2', 'bar3');
$col = new PropelCollection($data);
$expectedRes = array(false, false, true);
foreach ($col as $element) {
$this->assertEquals(array_shift($expectedRes), $col->isLast(), 'isLast() returns true only for the last element');
$this->assertEquals($element, $col->getCurrent(), 'isLast() does not change the current position');
}
}