public static function getParents() { $parents = array(); foreach (CounselingSpecPeer::doSelect(new Criteria()) as $d) { if (count($d->getCounselingSpecsRelatedByParent()) > 0) { $parents[] = $d->getId(); } } return $parents; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(CounselingSpecPeer::ID, $pks, Criteria::IN); $objs = CounselingSpecPeer::doSelect($criteria, $con); } return $objs; }
public function getCounselingSpecsRelatedByParent($criteria = null, $con = null) { include_once 'lib/model/om/BaseCounselingSpecPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCounselingSpecsRelatedByParent === null) { if ($this->isNew()) { $this->collCounselingSpecsRelatedByParent = array(); } else { $criteria->add(CounselingSpecPeer::PARENT, $this->getId()); CounselingSpecPeer::addSelectColumns($criteria); $this->collCounselingSpecsRelatedByParent = CounselingSpecPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(CounselingSpecPeer::PARENT, $this->getId()); CounselingSpecPeer::addSelectColumns($criteria); if (!isset($this->lastCounselingSpecRelatedByParentCriteria) || !$this->lastCounselingSpecRelatedByParentCriteria->equals($criteria)) { $this->collCounselingSpecsRelatedByParent = CounselingSpecPeer::doSelect($criteria, $con); } } } $this->lastCounselingSpecRelatedByParentCriteria = $criteria; return $this->collCounselingSpecsRelatedByParent; }
<td colspan="2" width="100%" align="left" valign="top"> <table width="100%" class="list_content"> <tr> <th align="center" ><?php echo $counseling_spec->getDescription() ? $counseling_spec->getDescription() : ''; ?> </th> <th align="center" width="5%">S</th> <th align="center" width="5%">PP</th> <th align="center" width="5%">B</th> </tr> <?php $ct = new Criteria(); $ct->add(CounselingSpecPeer::PARENT, $counseling_spec->getId()); $ct->addAscendingOrderByColumn(CounselingSpecPeer::ID); $specs = CounselingSpecPeer::doSelect($ct); $i = 0; foreach ($specs as $spec) { $i++; ?> <tr> <th align="left" style="font-weight: normal; padding: 0px 2px; "><?php echo $i . '. '; echo $spec->getDescription() ? $spec->getDescription() : ''; ?> </th> <th style="font-style: normal; padding: 0px 2px;"> <?php if ($stu_coun[$spec->getId()] == 10) { echo 'v'; } else {