public function getTaskResource(\core_kernel_classes_Resource $resource)
    {
        $tasksRootClass = $this->getClass(Task::TASK_CLASS);
        $taskResources = $tasksRootClass->searchInstances([Task::PROPERTY_LINKED_RESOURCE => $resource->getUri()]);

        return empty($taskResources) ? null : current($taskResources);
    }