Retrieve a FS task with the specified id
@param int $taskId
@return models\FileSystem\FsTask
@throws \GuzzleHttp\Exception\GuzzleException
@throws \alphayax\freebox\Exception\FreeboxApiException
161904
public function getTaskById($taskId)
    {
        $result = $this->callService('GET', self::API_FS_TASK . $taskId);

        return $result->getModel(models\FileSystem\FsTask::class);
    }
647962
protected function getTask($taskId)
    {
        if (!isset($this->tasks[$taskId])) {
            /** @var Queue $taskQueue */
            $taskQueue = $this->getServiceManager()->get(Queue::SERVICE_ID);
            $task = $taskQueue->getTask($taskId);
            if ($task === null) {
                throw new \common_exception_NotFound(__('Task not found'));
            }
            $this->tasks[$taskId] = $task;
        }
        return $this->tasks[$taskId];
    }
1005603
public static function find($tasklist, $taskId = null): Tasks
    {
        $service = static::getGoogleTasks($tasklist);

        $googleTasks = $service->getTask($taskId);

        return static::createFromGoogleTasks($googleTasks, $taskId);
    }
1050795
public function getTaskStatus($id, $options=array()){

        $data = array();
        
        $data['id'] = $id;

        $data = array_merge($data, $options);

        return $this->request($this->taskStatusUrl, $data);
    }
51462
public function delete(string $taskId = null)
    {
        $this->getGoogleTasks($this->taskId)->deleteTask($taskId ?? $this->id);
    }
1032647
public function getTask(int $taskId)
    {
        if ( ! $this->validateId($taskId)) {
            return false;
        }

        $result = $this->get('tasks/' . $taskId);

        $status = $result->getStatusCode();
        if (200 === $status) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
1055918
public function delete($taskId)
    {
        if (!isset($this->tasks[$taskId])) {
            return false;
        }
        unset($this->tasks[$taskId]);
        return true;
    }
1188949
public function getFromId( $diskId){
        $rest = $this->getService( self::API_STORAGE_PARTITION . $diskId);
        $rest->GET();

        return $rest->getResult( models\Storage\DiskPartition::class);
    }
1137937
public function retryTask($task_id, $delay = 1)
    {
        if (empty($task_id)) {
            throw new \InvalidArgumentException("Please set task_id");
        }
        $url = "projects/{$this->project_id}/tasks/$task_id/retry";
        $request = array('delay' => $delay);

        $this->setCommonHeaders();
        $res = json_decode($this->apiCall(self::POST, $url, $request));
        return $res->tasks[0]->id;
    }
840225
public function updateTask(models\FileSystem\FsTask $FsTask)
    {
        $result = $this->callService('PUT',self::API_FS_TASK . $FsTask->getId(), $FsTask);

        return $result->getSuccess();
    }
909422
public function create($projectId,$taskId,array $params = array())
    {
        $defaults = array(
            'text'      => null,
            'user_id'     => null,
            'user_email'  => null
        );
        $params = array_filter(array_merge($defaults, $params));
        
        $data = array('comment'=>$params);

        $path = '/projects/'.urlencode($projectId).'/tasks/'.urlencode($taskId).'/comments.json';
        return $this->post($path,$data);
    }
368320
public function getHashValue($fsTaskId)
    {
        $service = sprintf(self::API_FS_TASK_HASH, $fsTaskId);

        $result = $this->callService('GET', $service, []);

        return $result->getResult();
    }
106441
public function delete(string $taskID, string $listID = ''): \BearFramework\Tasks
    {
        $app = App::get();
        $this->lockList($listID);
        $list = $this->getListData($listID);
        if (isset($list[$taskID])) {
            unset($list[$taskID]);
            $this->setListData($listID, $list);
            $app->data->delete($this->getTaskDataKey($taskID, $listID));
        }
        $this->unlockList($listID);
        return $this;
    }
58072
public static function find($tasklist, $taskId = null): TaskLists
    {
        $service = static::getGoogleTasks($tasklist);

        $googleTasks = $service->getTask($taskId);

        return static::createFromGoogleTaskLists($googleTasks, $taskId);
    }
105860
public function remove($taskId)
    {
        $idList = $this->getIds();

        if (in_array($taskId, $idList)) {
            $this->getConfig()->remove($taskId);
            unlink($this->taskIdToFileName($taskId));
        }

        return $this;
    }
687253
public static function get_included_tasks($restoreid) {
        $rc = restore_controller_dbops::load_controller($restoreid);
        $tasks = $rc->get_plan()->get_tasks();
        $includedtasks = array();
        foreach ($tasks as $key => $task) {
            // Calculate if the task is being included
            $included = false;
            // blocks, based in blocks setting and parent activity/course
            if ($task instanceof restore_block_task) {
                if (!$task->get_setting_value('blocks')) { // Blocks not included, continue
                    continue;
                }
                $parent = basename(dirname(dirname($task->get_taskbasepath())));
                if ($parent == 'course') { // Parent is course, always included if present
                    $included = true;

                } else { // Look for activity_included setting
                    $included = $task->get_setting_value($parent . '_included');
                }

            // ativities, based on included setting
            } else if ($task instanceof restore_activity_task) {
                $included = $task->get_setting_value('included');

            // sections, based on included setting
            } else if ($task instanceof restore_section_task) {
                $included = $task->get_setting_value('included');

            // course always included if present
            } else if ($task instanceof restore_course_task) {
                $included = true;
            }

            // If included, add it
            if ($included) {
                $includedtasks[] = clone($task); // A clone is enough. In fact we only need the basepath.
            }
        }
        $rc->destroy(); // Always need to destroy.

        return $includedtasks;
    }
1133362
protected function getFilesystemFor($fileID)
    {
        return $this->applyToFileIDOnFilesystem(
            function (ParsedFileID $parsedFileID, Filesystem $fs) {
                return $fs;
            },
            $fileID
        );
    }