<?php foreach ($rows as $cat_subject) { $c = new Criteria(); $c->add(CatSubjectPeer::PARENT, $cat_subject->getId()); $cat_subject->child = CatSubjectPeer::doCount($c); $code_level = ''; for ($i = 0; $i < $level; $i++) { $code_level .= '• '; } ?> <tr id='cs_<?php echo $cat_subject->getId(); ?> ' class="list<?php ++$i; if ($i % 2 == 0) { echo ' even'; } ?> <?php echo $parent_class; ?> cs_<?php echo $parent_id; ?> _child"> <td id='cs_<?php echo $cat_subject->getId(); ?> _expand'>
public function countCatSubjectsRelatedByParent($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseCatSubjectPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(CatSubjectPeer::PARENT, $this->getId()); return CatSubjectPeer::doCount($criteria, $distinct, $con); }