PHP code example of garethmidwood / codebasehq-php

1. Go to this page and download the library: Download garethmidwood/codebasehq-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

garethmidwood / codebasehq-php example snippets


$codebaseHQ = new GarethMidwood\CodebaseHQ\CodebaseHQAccount(
    $apiUser,
    $apiKey,
    $apiHost
);

$users = $codebaseHQ->users();

$projects = $codebaseHQ->projects();

$project = $codebaseHQ->project('project-permalink');

$codebaseHQ->categories($project);
$codebaseHQ->priorities($project);
$codebaseHQ->statuses($project);
$codebaseHQ->types($project);

$codebaseHQ->tickets($project, $pageNo);

$project->getTickets();

$pageNo = 1;
$moreResultsToRetrieve = true;

while ($moreResultsToRetrieve) {
    $moreResultsToRetrieve = $codebaseHQ->tickets($project, $pageNo);
    $pageNo++;
}

// can be All|Day|Week|Month
$period = new GarethMidwood\CodebaseHQ\TimeSession\Period\Week;

$codebaseHQ->times($project, $period);

// times for the project
$project->getTimeSessions();

// times associated to a user
$user->getTimeSessions();

// times associated to a ticket
$ticket->getTimeSessions();