Skip to content

Commit

Permalink
#6264 Array syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Nov 10, 2020
1 parent 1103f2e commit 2c2880e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions classes/scheduledTask/ScheduledTaskDAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class ScheduledTaskDAO extends DAO {
function getLastRunTime($className) {
$result = $this->retrieve(
'SELECT last_run FROM scheduled_tasks WHERE class_name = ?',
array($className)
array[$className]
);
$row = (array) $result->current();
return $row?strtotime($this->datetimeFromDB($row['last_run'])):null;
$row = $result->current();
return $row ? strtotime($this->datetimeFromDB($row->last_run)) : null;
}

/**
Expand All @@ -48,8 +48,8 @@ function getLastRunTime($className) {
function updateLastRunTime($className, $timestamp = null) {
$result = $this->retrieve('SELECT COUNT(*) AS row_count FROM scheduled_tasks WHERE class_name = ?', [$className]);

$row = (array) $result->current();
if ($row && $row['row_count'] != 0) {
$row = $result->current();
if ($row && $row->row_count != 0) {
if (isset($timestamp)) return $this->update('UPDATE scheduled_tasks SET last_run = ' . $this->datetimeToDB($timestamp) . ' WHERE class_name = ?', [$className]);
return $this->update( 'UPDATE scheduled_tasks SET last_run = NOW() WHERE class_name = ?', [$className]);
} else {
Expand Down

0 comments on commit 2c2880e

Please sign in to comment.