Bug fixes

1) Quoted barewords in array construction
2) Added order by clause to all() to provide consistent ordering
This commit is contained in:
2011-04-25 01:52:56 +01:00
parent 5a5c3438c1
commit 72be6d6e5f

View File

@@ -111,7 +111,7 @@ class RippingCluster_Job {
$jobs = array(); $jobs = array();
$database = RippingCluster_Main::instance()->database(); $database = RippingCluster_Main::instance()->database();
foreach ($database->selectList('SELECT * FROM jobs WHERE id > 0') as $row) { foreach ($database->selectList('SELECT * FROM jobs WHERE id > 0 ORDER BY id DESC') as $row) {
$job = self::fromDatabaseRow($row); $job = self::fromDatabaseRow($row);
self::$cache[$job->id] = $job; self::$cache[$job->id] = $job;
@@ -212,7 +212,7 @@ class RippingCluster_Job {
$database->update( $database->update(
'DELETE FROM jobs WHERE id=:job_id LIMIT 1', 'DELETE FROM jobs WHERE id=:job_id LIMIT 1',
array( array(
array(name => 'job_id', value => $this->id, type => PDO::PARAM_INT), array('name' => 'job_id', 'value' => $this->id, 'type' => PDO::PARAM_INT),
) )
); );