Task
in package
implements
EntityInterface
Represents an user defined task on server.
Tags
Table of Contents
Interfaces
- EntityInterface
- Entity interface.
Methods
- __construct() : mixed
- Task constructor.
- delete() : bool
- Removes a task from server, if possible.
- getCommand() : string
- Returns the command.
- getId() : string|null
- Return the Task id.
- getType() : string
- Return the task type.
- hasConnection() : bool
- If this task has a connection set or not.
- isNew() : bool
- If the task object is a new created task (and not exists on server) <br> or if it is a representation of an existing one.
- jsonSerialize() : array<string|int, mixed>|mixed
- Return a JSON representation of Task object.
- save() : bool
- Saves this task on server, if possible
- setCommand() : void
- Sets the command to task.
- setConnection() : mixed
- Sets a connection to use.
- setId() : void
- Sets a custom id for task.
- toArray() : array<string|int, mixed>
- Returns a array representation of task.
Methods
__construct()
Task constructor.
public
__construct(string $name, string $command[, Connection|null $connection = null ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $name : string
-
Task name.
- $command : string
-
Task command.
- $connection : Connection|null = null
-
Connection to use.
- $options : array<string|int, mixed> = []
-
Additional options for task.
Tags
delete()
Removes a task from server, if possible.
public
delete() : bool
Tags
Return values
bool —True if operation was successful, false otherwise
getCommand()
Returns the command.
public
getCommand() : string
Return values
stringgetId()
Return the Task id.
public
getId() : string|null
Return values
string|null —Task id, if exists or null if the task is a new one.
getType()
Return the task type.
public
getType() : string
Return values
stringhasConnection()
If this task has a connection set or not.
public
hasConnection() : bool
Return values
bool —True of has a connection object. False otherwise.
isNew()
If the task object is a new created task (and not exists on server) <br> or if it is a representation of an existing one.
public
isNew() : bool
Return values
booljsonSerialize()
Return a JSON representation of Task object.
public
jsonSerialize() : array<string|int, mixed>|mixed
Return values
array<string|int, mixed>|mixedsave()
Saves this task on server, if possible
public
save() : bool
Tags
Return values
bool —True if operation was successful, false otherwise
setCommand()
Sets the command to task.
public
setCommand(string $command) : void
Parameters
- $command : string
setConnection()
Sets a connection to use.
public
setConnection(Connection $connection) : mixed
Parameters
- $connection : Connection
-
Connection object to use.
setId()
Sets a custom id for task.
public
setId(string $id) : void
Parameters
- $id : string
toArray()
Returns a array representation of task.
public
toArray() : array<string|int, mixed>