/** * Returns the number of related ExportLogEntry objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con * @return int Count of related ExportLogEntry objects. * @throws PropelException */ public function countExportLogEntrys(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(ExportJobPeer::DATABASE_NAME); } else { $criteria = clone $criteria; } if ($distinct) { $criteria->setDistinct(); } $count = null; if ($this->collExportLogEntrys === null) { if ($this->isNew()) { $count = 0; } else { $criteria->add(ExportLogEntryPeer::JOB, $this->id); $count = ExportLogEntryPeer::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(ExportLogEntryPeer::JOB, $this->id); if (!isset($this->lastExportLogEntryCriteria) || !$this->lastExportLogEntryCriteria->equals($criteria)) { $count = ExportLogEntryPeer::doCount($criteria, $con); } else { $count = count($this->collExportLogEntrys); } } else { $count = count($this->collExportLogEntrys); } } return $count; }
if (isset($_GET['request']) && $_GET['request'] == 'fetch') { // We're our AJAX client wanting to get new log data $result = array(); $c = new Criteria(); $c->add(ExportLogEntryPeer::JOB, $_GET['id']); $c->setLimit($_POST['rp']); $c->setOffset(isset($_POST['page']) ? ($_POST['page'] - 1) * $_POST['rp'] : 0); $c->addDescendingOrderByColumn(ExportLogEntryPeer::ID); $entries = $exportJob->getExportLogEntrys($c); foreach ($entries as $entry) { $results['rows'][] = array('id' => $entry->getId(), 'cell' => array($entry->getTime(), $entry->getReadableType($entry->getType()), $entry->getText())); } $c = new Criteria(); $c->add(ExportLogEntryPeer::JOB, $exportJob->getId()); $results['page'] = $_POST['page']; $results['total'] = ExportLogEntryPeer::doCount($c); ?> <?php print json_encode($results); exit; } if (isset($_POST['request'])) { if (!strlen(trim($_POST['job_name']))) { $status_msg = "Job name must be provided."; } else { // Instantiate an engine $engineClass = $_POST['job_engine']; $engine = new $engineClass(null); // Wonky, I know. $error = $engine->validateConfig();