/** * Returns list of conditions * @return array */ public static function listConditions() { $db = Zend_Registry::get('dbAdapter'); $audit = new Audit(); $sqlSelect = $db->select()->from($audit->_table)->where('auditId != 0')->group('objectClass')->group('type'); $conditions = $audit->getIterator($sqlSelect); $listConditions = array(); foreach ($conditions as $condition) { $prettyName = $condition->objectClass . '->'; switch ($condition->type) { case WebVista_Model_ORM::REPLACE: $prettyName .= __('Replace'); break; case WebVista_Model_ORM::INSERT: $prettyName .= __('Insert'); break; case WebVista_Model_ORM::UPDATE: $prettyName .= __('Update'); break; case WebVista_Model_ORM::DELETE: $prettyName .= __('Delete'); break; default: $prettyName .= __('Unknown'); break; } $listConditions[$condition->auditId] = $prettyName; } return $listConditions; }
protected function _populateAudits() { $audit = new Audit(); $db = Zend_Registry::get('dbAdapter'); $dbSelect = $db->select()->from($audit->_table)->where("startProcessing = '0000-00-00 00:00:00'")->orWhere("endProcessing = '0000-00-00 00:00:00'"); $this->_audits = $audit->getIterator($dbSelect); }