PHP Класс Kimai_Remote_Api

Every public method in here, will be available for SOAP/JSON Requests and auto-discovered for WSDL queries.
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( )
authenticate ( string $username, string $password ) : array Authenticates a user and returns the API key.
getActiveRecording ( string $apiKey ) : array Returns an array with values of the currently active recording.
getCustomers ( string $apiKey ) : array | boolean Return a list of customers. A customer can only see himself.
getExpenseRecord ( string $apiKey, integer $id ) : array
getExpenses ( string $apiKey, integer $from, integer $to, integer $refundable, integer $cleared, integer $start, integer $limit ) : array Returns a list of expenses.
getProjects ( string $apiKey, $includeTasks = false ) : array | boolean Return a list of projects. Customers are only shown their projects.
getTasks ( string $apiKey, integer | array $projectId = null ) : array | boolean Return a list of tasks. Customers are only shown tasks which are used for them. If a project is set as filter via the project parameter only tasks for that project are shown.
getTimesheet ( string $apiKey, integer $from, integer $to, integer $cleared, integer $start, integer $limit ) : array Returns a list of recorded times.
getTimesheetRecord ( string $apiKey, integer $id ) : array
getUsers ( string $apiKey ) : array | boolean Return a list of users. Customers are not shown any users. The type of the current user decides which users are shown to him.
removeExpenseRecord ( string $apiKey, integer $id ) : array
removeTimesheetRecord ( string $apiKey, integer $id ) : array
setExpenseRecord ( string $apiKey, array $record, boolean $doUpdate ) : array
setTimesheetRecord ( string $apiKey, array $record, boolean $doUpdate ) : array
startRecord ( string $apiKey, integer $projectId, integer $activityId ) : array The user started the recording of an activity via the buzzer. If this method is called while another recording is running the first one will be stopped.
stopRecord ( string $apiKey, integer $entryId ) : boolean Stops the currently running recording. If $entryId is empty the current activity will be stopped.

Защищенные методы

Метод Описание
getAuthErrorResult ( ) : array Returns the result array for failed authentication.
getAuthenticator ( ) : Kimai_Auth_Abstract Returns the configured Authenticator for Kimai.
getDebugResult ( array $items, array $debugItems ) : array Returns the array for success responses.
getErrorResult ( string $msg = null ) : array Returns the array for failure messages.
getSuccessResult ( array $items, integer $total ) : array Returns the array for success responses.

Приватные методы

Метод Описание
getBackend ( ) : Kimai_Remote_Database Returns the database object to access Kimais system.
getKimaiEnv ( ) : integer | null Returns the current kimai environment.
getTasksByProjectId ( string $projectId, array $user ) : array Returns an array of tasks for the given projectId.
getUser ( ) : array Returns the current users config array.
init ( string $apiKey, string $permission = null, $allowCustomer = false ) : boolean Checks if the given $apiKey is allowed to fetch data from this system.

Описание методов

__construct() публичный Метод

public __construct ( )

authenticate() публичный Метод

The result is either an empty string (not allowed or need to login first via web-interface) or a string with max 30 character, representing the users API key.
public authenticate ( string $username, string $password ) : array
$username string
$password string
Результат array

getActiveRecording() публичный Метод

Returns an array with values of the currently active recording.
public getActiveRecording ( string $apiKey ) : array
$apiKey string
Результат array

getAuthErrorResult() защищенный Метод

Returns the result array for failed authentication.
protected getAuthErrorResult ( ) : array
Результат array

getAuthenticator() защищенный Метод

Returns the configured Authenticator for Kimai.
protected getAuthenticator ( ) : Kimai_Auth_Abstract
Результат Kimai_Auth_Abstract

getCustomers() публичный Метод

Return a list of customers. A customer can only see himself.
public getCustomers ( string $apiKey ) : array | boolean
$apiKey string
Результат array | boolean

getDebugResult() защищенный Метод

Returns the array for success responses.
protected getDebugResult ( array $items, array $debugItems ) : array
$items array
$debugItems array
Результат array

getErrorResult() защищенный Метод

Returned messages will always be a string, but might be empty!
protected getErrorResult ( string $msg = null ) : array
$msg string
Результат array

getExpenseRecord() публичный Метод

public getExpenseRecord ( string $apiKey, integer $id ) : array
$apiKey string
$id integer
Результат array

getExpenses() публичный Метод

Returns a list of expenses.
public getExpenses ( string $apiKey, integer $from, integer $to, integer $refundable, integer $cleared, integer $start, integer $limit ) : array
$apiKey string
$from integer a MySQL DATE/DATETIME/TIMESTAMP
$to integer a MySQL DATE/DATETIME/TIMESTAMP
$refundable integer -1 all, 0 only refundable
$cleared integer -1 no filtering, 0 uncleared only, 1 cleared only
$start integer limit start
$limit integer count rows to select
Результат array

getProjects() публичный Метод

Return a list of projects. Customers are only shown their projects.
public getProjects ( string $apiKey, $includeTasks = false ) : array | boolean
$apiKey string
Результат array | boolean

getSuccessResult() защищенный Метод

Returns the array for success responses.
protected getSuccessResult ( array $items, integer $total ) : array
$items array
$total integer = 0
Результат array

getTasks() публичный Метод

Return a list of tasks. Customers are only shown tasks which are used for them. If a project is set as filter via the project parameter only tasks for that project are shown.
public getTasks ( string $apiKey, integer | array $projectId = null ) : array | boolean
$apiKey string
$projectId integer | array
Результат array | boolean

getTimesheet() публичный Метод

Returns a list of recorded times.
public getTimesheet ( string $apiKey, integer $from, integer $to, integer $cleared, integer $start, integer $limit ) : array
$apiKey string
$from integer a MySQL DATE/DATETIME/TIMESTAMP
$to integer a MySQL DATE/DATETIME/TIMESTAMP
$cleared integer -1 no filtering, 0 uncleared only, 1 cleared only
$start integer limit start
$limit integer count rows to select
Результат array

getTimesheetRecord() публичный Метод

public getTimesheetRecord ( string $apiKey, integer $id ) : array
$apiKey string
$id integer
Результат array

getUsers() публичный Метод

Returns false if the call could not be executed, null if no users could be found or an array of users.
См. также: get_watchable_users
public getUsers ( string $apiKey ) : array | boolean
$apiKey string
Результат array | boolean

removeExpenseRecord() публичный Метод

public removeExpenseRecord ( string $apiKey, integer $id ) : array
$apiKey string
$id integer
Результат array

removeTimesheetRecord() публичный Метод

public removeTimesheetRecord ( string $apiKey, integer $id ) : array
$apiKey string
$id integer
Результат array

setExpenseRecord() публичный Метод

public setExpenseRecord ( string $apiKey, array $record, boolean $doUpdate ) : array
$apiKey string
$record array
$doUpdate boolean
Результат array

setTimesheetRecord() публичный Метод

public setTimesheetRecord ( string $apiKey, array $record, boolean $doUpdate ) : array
$apiKey string
$record array
$doUpdate boolean
Результат array

startRecord() публичный Метод

If $projectId and $activityId are empty the last activity will be restarted.
public startRecord ( string $apiKey, integer $projectId, integer $activityId ) : array
$apiKey string
$projectId integer
$activityId integer
Результат array

stopRecord() публичный Метод

Stops the currently running recording. If $entryId is empty the current activity will be stopped.
public stopRecord ( string $apiKey, integer $entryId ) : boolean
$apiKey string
$entryId integer
Результат boolean