Kimai_Database_Mysql::timeSheet_get_data PHP Method

timeSheet_get_data() public method

Returns the data of a certain time record
Author: th
public timeSheet_get_data ( integer $timeEntryID ) : array
$timeEntryID integer timeEntryID of the record
return array the record's data (time, activity id, project id etc) as array, false on failure
    public function timeSheet_get_data($timeEntryID)
    {
        $timeEntryID = MySQL::SQLValue($timeEntryID, MySQL::SQLVALUE_NUMBER);
        $table = $this->getTimeSheetTable();
        $projectTable = $this->getProjectTable();
        $activityTable = $this->getActivityTable();
        $customerTable = $this->getCustomerTable();
        $select = "SELECT {$table}.*, {$projectTable}.name AS projectName, {$customerTable}.name AS customerName, {$activityTable}.name AS activityName, {$customerTable}.customerID AS customerID\n      \t\t\t\tFROM {$table}\n                \tJOIN {$projectTable} USING(projectID)\n                \tJOIN {$customerTable} USING(customerID)\n                \tJOIN {$activityTable} USING(activityID)";
        if ($timeEntryID) {
            $result = $this->conn->Query("{$select} WHERE timeEntryID = " . $timeEntryID);
        } else {
            $result = $this->conn->Query("{$select} WHERE userID = " . $this->kga['user']['userID'] . " ORDER BY timeEntryID DESC LIMIT 1");
        }
        if (!$result) {
            $this->logLastError('timeSheet_get_data');
            return false;
        }
        return $this->conn->RowArray(0, MYSQLI_ASSOC);
    }
Kimai_Database_Mysql