Task assignment
Table of contents
See how to create a $factory
List task assignments
Returns a list of all task assignments
Usage
$response = $factory->projects()->taskAssignments()->listTaskAssignments($isActive, $updatedSince, $meta);
$meta = $response->getMeta();
$meta instanceof \Lsv\TimeharvestSdk\Response\MetaResponse
foreach ($response->getData() as $client) {
$client instanceof \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
}
Parameters
Parameter |
Required |
Type |
Description |
$isActive |
false |
bool |
Select only active or inactive clients |
$updatedSince |
false |
DateTimeInterface |
Only select clients updated after this date |
$meta |
false |
\Lsv\TimeharvestSdk\Response\MetaResponse |
Pagination |
Response
$response->getMeta() instanceof \Lsv\TimeharvestSdk\Response\MetaResponse;
$response->getData() array of \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
List task assignments by project
Returns a list of all task assignments for a project
Usage
$response = $factory->projects()->taskAssignments()->listTaskAssignmentsForProject($project, $isActive, $updatedSince, $meta);
$meta = $response->getMeta();
$meta instanceof \Lsv\TimeharvestSdk\Response\MetaResponse
foreach ($response->getData() as $client) {
$client instanceof \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
}
Parameters
Parameter |
Required |
Type |
Description |
$project |
true |
int | \Lsv\TimeharvestSdk\Response\Project\ProjectData |
The ID or a ProjectData of the tasks assigned to this project |
$isActive |
false |
bool |
Select only active or inactive clients |
$updatedSince |
false |
DateTimeInterface |
Only select clients updated after this date |
$meta |
false |
\Lsv\TimeharvestSdk\Response\MetaResponse |
Pagination |
Response
$response->getMeta() instanceof \Lsv\TimeharvestSdk\Response\MetaResponse;
$response->getData() array of \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
Retrieve task assignment
Usage
$response = $factory->projects()->taskAssignments()->retrieveTaskAssignment($project, $assignment);
Parameters
Parameter |
Required |
Type |
Description |
$project |
true |
int | \Lsv\TimeharvestSdk\Response\Project\ProjectData |
The ID or a ProjectData of the project needed to be retrieved |
$assignment |
true |
int | \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData |
The TaskAssignmentData that needed to be retrieved |
Response
$response->getData() instanceof \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
Create task assignment
Usage
$dto = new \Lsv\TimeharvestSdk\Dto\Projects\TaskAssignments\CreateTaskAssignmentDto(
$task,
$isActive,
$billable,
$hourlyRate,
$budget,
);
$response = $factory->projects()->taskAssignments()->createTaskAssignment($project, $dto);
Parameters
Parameter |
Required |
Type |
Description |
$project |
true |
int | \Lsv\TimeharvestSdk\Response\Project\ProjectData |
The ID or a ProjectData of the project needed to be created with this task |
$task |
true |
int | \Lsv\TimeharvestSdk\Response\Task\TaskData |
The ID of the task to associate this project with. |
$is_active |
false |
boolean |
Whether the project is active or archived. |
$billable |
false |
boolean |
Whether the project is billable or not. |
$hourly_rate |
false |
float |
Rate for projects billed by Project Hourly Rate. |
$budget |
false |
float |
The budget in hours for the project when budgeting by time. |
Response
$response->getData() instanceof \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
Update task assignment
Usage
$dto = new \Lsv\TimeharvestSdk\Dto\Projects\TaskAssignments\UpdateTaskAssignmentDto(
$isActive,
$billable,
$hourlyRate,
$budget,
);
$response = $factory->projects()->taskAssignments()->updateTaskAssignment($project, $assignment, $dto);
Parameters
Parameter |
Required |
Type |
Description |
$project |
true |
int | \Lsv\TimeharvestSdk\Response\Project\ProjectData |
The ID or a ProjectData of the project needed to be created with this task |
$task |
true |
int | \Lsv\TimeharvestSdk\Response\Task\TaskData |
The ID of the task to associate this project with. |
$is_active |
false |
boolean |
Whether the project is active or archived. |
$billable |
false |
boolean |
Whether the project is billable or not. |
$hourly_rate |
false |
float |
Rate for projects billed by Project Hourly Rate. |
$budget |
false |
float |
The budget in hours for the project when budgeting by time. |
Response
$response->getData() instanceof \Lsv\TimeharvestSdk\Response\Project\TaskAssignment\TaskAssignmentData
Delete task assignment
Usage
$factory->projects()->taskAssignments()->deleteTaskAssignment($project, $assignment);
Parameters
Parameter |
Required |
Type |
Description |
$project |
true |
int | \Lsv\TimeharvestSdk\Response\Project\ProjectData |
The ID or a ProjectData of the project needed to be created with this task |
$task |
true |
int | \Lsv\TimeharvestSdk\Response\Task\TaskData |
The ID of the task to associate this project with. |