} ?> "> <td><?php echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage(); ?> </td> <td class='first' align="left"><?php echo $cat_category->getName() ? $cat_category->toString() : '-'; ?> </td> <td align="left"> <?php $c = new Criteria(); $c->add(CatalogPeer::CAT_CATEGORY_ID, $cat_category->getId()); $count_title = CatalogPeer::doCount($c); echo $count_title > 0 ? $count_title : '-'; ?> </td> <td align="left"> <?php $cw = new Criteria(); $cw->add(CatalogPeer::CAT_CATEGORY_ID, $cat_category->getId()); $cw->addJoin(ColItemPeer::CATALOG_ID, CatalogPeer::ID); $count_copies = ColItemPeer::doCount($cw); echo $count_copies > 0 ? $count_copies : '-'; ?> </td> </tr> <?php }
public function countCatalogs($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseCatalogPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(CatalogPeer::PUBLISHER_ID, $this->getId()); return CatalogPeer::doCount($criteria, $distinct, $con); }