CommonITILObject::updateActionTime PHP Метод

updateActionTime() публичный Метод

Update actiontime of the object based on actiontime of the tasks
public updateActionTime ( $ID ) : boolean
$ID ID of the object
Результат boolean : success
    function updateActionTime($ID)
    {
        global $DB;
        $tot = 0;
        $tasktable = getTableForItemType($this->getType() . 'Task');
        $query = "SELECT SUM(`actiontime`)\n                FROM `{$tasktable}`\n                WHERE `" . $this->getForeignKeyField() . "` = '{$ID}'";
        if ($result = $DB->query($query)) {
            $sum = $DB->result($result, 0, 0);
            if (!is_null($sum)) {
                $tot += $sum;
            }
        }
        $query2 = "UPDATE `" . $this->getTable() . "`\n                 SET `actiontime` = '{$tot}'\n                 WHERE `id` = '{$ID}'";
        return $DB->query($query2);
    }
CommonITILObject