Kimai_Database_Mysql::stopRecorder PHP Method

stopRecorder() public method

Performed when the stop buzzer is hit.
Author: th, sl
public stopRecorder ( integer $id ) : boolean
$id integer id of the entry to stop
return boolean
    public function stopRecorder($id)
    {
        $table = $this->getTimeSheetTable();
        $activity = $this->timeSheet_get_data($id);
        $filter['timeEntryID'] = $activity['timeEntryID'];
        $filter['end'] = 0;
        // only update running activities
        $rounded = Kimai_Rounding::roundTimespan($activity['start'], time(), $this->kga->getRoundPrecisionRecorderTimes(), $this->kga->isRoundDownRecorderTimes());
        $values['start'] = $rounded['start'];
        $values['end'] = $rounded['end'];
        $values['duration'] = $values['end'] - $values['start'];
        $query = MySQL::BuildSQLUpdate($table, $values, $filter);
        return $this->conn->Query($query);
    }
Kimai_Database_Mysql