Exemple #1
0
		<td><?php 
echo NagiosHostTemplatePeer::doCount(new Criteria());
?>
</td>
	</tr>
	<tr class="odd">
		<td><strong>Total Nagios Service Templates:</strong></td>
		<td><?php 
echo NagiosServiceTemplatePeer::doCount(new Criteria());
?>
</td>
	</tr>
	<tr>
		<td><strong>Total Nagios Hosts:</strong></td>
		<td><?php 
echo NagiosHostPeer::doCount(new Criteria());
?>
</td>
	</tr>
	<tr class="odd">
		<td><strong>Total Nagios Services:</strong></td>
		<td><?php 
echo NagiosServicePeer::doCountAll();
?>
</td>
	</tr>

</table>

<?php 
print_window_footer();
Exemple #2
0
 /**
  * Returns the number of related NagiosHost objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related NagiosHost objects.
  * @throws     PropelException
  */
 public function countNagiosHostsRelatedByEventHandler(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(NagiosCommandPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collNagiosHostsRelatedByEventHandler === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(NagiosHostPeer::EVENT_HANDLER, $this->id);
             $count = NagiosHostPeer::doCount($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return count of the collection.
             $criteria->add(NagiosHostPeer::EVENT_HANDLER, $this->id);
             if (!isset($this->lastNagiosHostRelatedByEventHandlerCriteria) || !$this->lastNagiosHostRelatedByEventHandlerCriteria->equals($criteria)) {
                 $count = NagiosHostPeer::doCount($criteria, $con);
             } else {
                 $count = count($this->collNagiosHostsRelatedByEventHandler);
             }
         } else {
             $count = count($this->collNagiosHostsRelatedByEventHandler);
         }
     }
     return $count;
 }
 /**
  * Returns the number of related NagiosHost objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related NagiosHost objects.
  * @throws     PropelException
  */
 public function countNagiosHostsRelatedByNotificationPeriod(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(NagiosTimeperiodPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collNagiosHostsRelatedByNotificationPeriod === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(NagiosHostPeer::NOTIFICATION_PERIOD, $this->id);
             $count = NagiosHostPeer::doCount($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return count of the collection.
             $criteria->add(NagiosHostPeer::NOTIFICATION_PERIOD, $this->id);
             if (!isset($this->lastNagiosHostRelatedByNotificationPeriodCriteria) || !$this->lastNagiosHostRelatedByNotificationPeriodCriteria->equals($criteria)) {
                 $count = NagiosHostPeer::doCount($criteria, $con);
             } else {
                 $count = count($this->collNagiosHostsRelatedByNotificationPeriod);
             }
         } else {
             $count = count($this->collNagiosHostsRelatedByNotificationPeriod);
         }
     }
     return $count;
 }
Exemple #4
0
 public function getNumberOfChildren()
 {
     $c = new Criteria();
     $c->add(NagiosHostParentPeer::PARENT_HOST, $this->getId());
     return NagiosHostPeer::doCount($c);
 }