exists( $sAppUid )) { $con->begin(); //update record //$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid ); //$aFields = $oRow->toArray(BasePeer::TYPE_FIELDNAME); //$this->fromArray($aFields,BasePeer::TYPE_FIELDNAME); $this->setNew( false ); //set field $this->setAppUid( $sAppUid ); $this->setAppUpdated( $iUpdated ); if ($this->validate()) { $result = $this->save(); } else { $con->rollback(); throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." )); } $con->commit(); return $result; } else { //create record //set values $this->setAppUid( $sAppUid ); $this->setAppUpdated( $iUpdated ); if ($this->validate()) { $result = $this->save(); } else { $e = new Exception( "Failed Validation in class " . get_class( $this ) . "." ); //$e->aValidationFailures=$this->getValidationFailures(); throw ($e); } $con->commit(); return $result; } } catch (Exception $e) { $con->rollback(); throw ($e); } } /** * Returns the list of updated applications * array of Entity_AppSolrQueue */ public function getListUpdatedApplications () { $updatedApplications = array (); try { $c = new Criteria(); $c->addSelectColumn( AppSolrQueuePeer::APP_UID ); $c->addSelectColumn( AppSolrQueuePeer::APP_UPDATED ); //"WHERE $c->add( AppSolrQueuePeer::APP_UPDATED, 0, Criteria::NOT_EQUAL ); $rs = AppSolrQueuePeer::doSelectRS( $c ); $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC ); //echo $c->toString(); $rs->next(); $row = $rs->getRow(); while (is_array( $row )) { $appSolrQueue = Entity_AppSolrQueue::createEmpty(); $appSolrQueue->appUid = $row['APP_UID']; $appSolrQueue->appUpdated = $row['APP_UPDATED']; $updatedApplications[] = $appSolrQueue; $rs->next(); $row = $rs->getRow(); } return $updatedApplications; } catch (Exception $e) { $con->rollback(); throw ($e); } } }