Download the PHP package garethmidwood/codebasehq-php without Composer
On this page you can find all versions of the php package garethmidwood/codebasehq-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download garethmidwood/codebasehq-php
More information about garethmidwood/codebasehq-php
Files in garethmidwood/codebasehq-php
Package codebasehq-php
Short Description A PHP library for the CodebaseHQ API
License
Informations about the package codebasehq-php
codebasehq-php
A PHP library for the CodebaseHQ API
Note
This library creates objects for users, projects, tickets etc. When you make a query to retrieve tickets (this is just an example, it can apply to other classes too) it will attempt to look up the users and link the ticket assignee/reporter with the user. If you haven't already retrieved users then your ticket will have no assignee or reporter assigned to it. Because of this, the best steps to take are:
- retrieve users
- retrieve projects
- retrieve tickets for the project
- retrieve time sessions for the project
Instructions for each of these steps can be found below.
Usage
Connecting to the API
In order to connect to and query the codebase API you need to create a CodebaseHQAccount object
Retrieving All Users
Users are pulled at the account level
This returns a User\Collection
- searching should be done on the collection, the class has a few helper methods for this
Retrieving Projects
Projects can be pulled as a whole for the account, or individually by permalink.
Retrieving All Projects
Projects are also pulled at the account level
This returns a Project\Collection
- searching should be done on the collection, the class has a few helper methods for this
Retrieving Individual Projects
You can pull an individual project by the permalink (note the method name is singular)
This returns a Project\Project
- not a collection
Populating Project Details
Projects can be populated with all of their categories, priorities, statuses and types.
Retrieving Tickets for a Project
Tickets can only be retrieved if you have a Project\Project
object.
The tickets method returns a boolean indicating whether there are further results (as the results are paginated).
The tickets themselves are added to a Ticket\Collection
in the project. As always, searching should be done on the collection, the class has a few helper methods for this
Pagination
Tickets are paginated, with 20 per page. You can write a simple loop to pull all tickets for the project
Retrieving Time Sessions for a Project
Time Sessions can only be retrieved if you have a Project\Project
object.
You must also pass through a period to retrieve the times for, this can be a day/week/month or all - classes exist for each one.
Time sessions will be associated with the project, the ticket and the user if you have populated those collections.