Merge pull request #854 from Jennydmz/2460cb7ad42610067dafefe181a1fa47d0478266
CODE STYLE.
This commit is contained in:
@@ -3,25 +3,25 @@
|
||||
require_once 'classes/model/om/BaseAppSolrQueue.php';
|
||||
require_once 'classes/entities/AppSolrQueue.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'APP_SOLR_QUEUE' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
* @package classes.model
|
||||
*/
|
||||
class AppSolrQueue extends BaseAppSolrQueue
|
||||
{
|
||||
public function exists($sAppUid)
|
||||
|
||||
public function exists ($sAppUid)
|
||||
{
|
||||
try {
|
||||
$oRow = AppSolrQueuePeer::retrieveByPK( $sAppUid );
|
||||
if (!is_null($oRow)) {
|
||||
if (! is_null( $oRow )) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -31,46 +31,46 @@ class AppSolrQueue extends BaseAppSolrQueue
|
||||
}
|
||||
}
|
||||
|
||||
public function createUpdate($sAppUid, $iUpdated)
|
||||
public function createUpdate ($sAppUid, $iUpdated)
|
||||
{
|
||||
$con = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
|
||||
$con = Propel::getConnection( AppSolrQueuePeer::DATABASE_NAME );
|
||||
try {
|
||||
if ($this->exists($sAppUid)) {
|
||||
if ($this->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);
|
||||
$this->setNew( false );
|
||||
//set field
|
||||
$this->setAppUid($sAppUid);
|
||||
$this->setAppUpdated($iUpdated);
|
||||
$this->setAppUid( $sAppUid );
|
||||
$this->setAppUpdated( $iUpdated );
|
||||
if ($this->validate()) {
|
||||
$result=$this->save();
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw(new Exception("Failed Validation in class ".get_class($this)."."));
|
||||
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);
|
||||
$this->setAppUid( $sAppUid );
|
||||
$this->setAppUpdated( $iUpdated );
|
||||
if ($this->validate()) {
|
||||
$result=$this->save();
|
||||
$result = $this->save();
|
||||
} else {
|
||||
$e=new Exception("Failed Validation in class ".get_class($this).".");
|
||||
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
|
||||
//$e->aValidationFailures=$this->getValidationFailures();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
$con->commit();
|
||||
return $result;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,25 +78,25 @@ class AppSolrQueue extends BaseAppSolrQueue
|
||||
* Returns the list of updated applications
|
||||
* array of Entity_AppSolrQueue
|
||||
*/
|
||||
public function getListUpdatedApplications()
|
||||
public function getListUpdatedApplications ()
|
||||
{
|
||||
$updatedApplications = array();
|
||||
$updatedApplications = array ();
|
||||
try {
|
||||
$c = new Criteria();
|
||||
|
||||
$c->addSelectColumn(AppSolrQueuePeer::APP_UID);
|
||||
$c->addSelectColumn(AppSolrQueuePeer::APP_UPDATED);
|
||||
$c->addSelectColumn( AppSolrQueuePeer::APP_UID );
|
||||
$c->addSelectColumn( AppSolrQueuePeer::APP_UPDATED );
|
||||
|
||||
//"WHERE
|
||||
$c->add(AppSolrQueuePeer::APP_UPDATED, 0, Criteria::NOT_EQUAL);
|
||||
$c->add( AppSolrQueuePeer::APP_UPDATED, 0, Criteria::NOT_EQUAL );
|
||||
|
||||
$rs = AppSolrQueuePeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs = AppSolrQueuePeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
//echo $c->toString();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
|
||||
while (is_array($row)) {
|
||||
while (is_array( $row )) {
|
||||
$appSolrQueue = Entity_AppSolrQueue::createEmpty();
|
||||
$appSolrQueue->appUid = $row['APP_UID'];
|
||||
$appSolrQueue->appUpdated = $row['APP_UPDATED'];
|
||||
@@ -107,7 +107,7 @@ class AppSolrQueue extends BaseAppSolrQueue
|
||||
return $updatedApplications;
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
throw($e);
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user