Nextcloud PHP API (master)

IManager

API surface for apps interacting with and making use of TextToImage providers without knowing which providers are installed

Tags
since
28.0.0

Table of Contents

Methods

deleteTask()  : void
Delete a task that has been scheduled before
getProviders()  : array<int, IProvider>
getTask()  : Task
getUserTask()  : Task
getUserTasksByApp()  : array<string|int, Task>
hasProviders()  : bool
runOrScheduleTask()  : void
runTask()  : void
scheduleTask()  : void
Will schedule a TextToImage process in the background. The result will become available with the \OCP\TextToImage\TaskSuccessfulEvent If inference fails a \OCP\TextToImage\Events\TaskFailedEvent will be dispatched instead

Methods

deleteTask()

Delete a task that has been scheduled before

public deleteTask(Task $task) : void
Parameters
$task : Task

The task to delete

Tags
since
28.0.0

getTask()

public getTask(int $id) : Task
Parameters
$id : int

The id of the task

Tags
throws
RuntimeException

If the query failed

throws
TaskNotFoundException

If the task could not be found

since
28.0.0
Return values
Task

getUserTask()

public getUserTask(int $id, string|null $userId) : Task
Parameters
$id : int

The id of the task

$userId : string|null

The user id that scheduled the task

Tags
throws
RuntimeException

If the query failed

throws
TaskNotFoundException

If the task could not be found

since
28.0.0
Return values
Task

getUserTasksByApp()

public getUserTasksByApp(string|null $userId, string $appId[, string|null $identifier = null ]) : array<string|int, Task>
Parameters
$userId : string|null
$appId : string
$identifier : string|null = null
Tags
since
28.0.0
throws
RuntimeException

If the query failed

Return values
array<string|int, Task>

hasProviders()

public hasProviders() : bool
Tags
since
28.0.0
Return values
bool

runTask()

public runTask(Task $task) : void
Parameters
$task : Task

The task to run

Tags
throws
PreConditionNotMetException

If no or not the requested provider was registered but this method was still called

throws
TaskFailureException

If something else failed. When this is thrown task status was already set to failure.

since
28.0.0

scheduleTask()

Will schedule a TextToImage process in the background. The result will become available with the \OCP\TextToImage\TaskSuccessfulEvent If inference fails a \OCP\TextToImage\Events\TaskFailedEvent will be dispatched instead

public scheduleTask(Task $task) : void
Parameters
$task : Task

The task to schedule

Tags
throws
PreConditionNotMetException

If no provider was registered but this method was still called

throws
Exception

If there was a problem inserting the task into the database

since
28.0.0

        
On this page

Search results