This repository has been archived by the owner on Dec 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ActivecollabAPI.class.php
85 lines (64 loc) · 2.6 KB
/
ActivecollabAPI.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/*******************************************************
ActivecollabAPI is a PHP library that simplifies the
task of communicating with an activeCollab installation
using the activeCollab API.
Author: Joel Rowley
Copyright (c): 2010 Rowley Controls, all rights reserved
Version: 0.0.1
********************************************************/
//require_once 'lib/Snoopy.class.php'; // This class does the communication
// using HTTP GET and POST to the
// activeCollab installation.
//require_once 'objects/AcTicket.class.php';
//require_once 'exceptions/HttpException.class.php';
require_once 'models/ModelAcObject.class.php';
require_once 'models/ModelAcTicket.class.php';
class ActivecollabAPI
{
var $Objects = null; // ModelAcObject instance used for
// manipulating objects in the activeCollab
// install.
var $Tickets = null; // ModelAcTicket object used for manipulating
// tickets in the activeCollab install.
/*======================================================================*\
Function: Constructor
Purpose: initialize the ActivecollabAPI class
with the default values.
Input: $acBaseURL the base URL of the activeCollab
installation. This should include the
trailing slash.
$userAPIKey the API key that the class should use.
Output: ActivecollabAPI object
\*======================================================================*/
public function __construct($acBaseURL, $userAPIKey=null)
{
$this->Objects = new ModelAcObject($acBaseURL, $userAPIKey);
$this->Tickets = new ModelAcTicket($acBaseURL, $userAPIKey);
}
/*======================================================================*\
Function: setBaseURL
Purpose: Set the base URL of the activeCollab installation.
Input: $acBaseURL the base URL of the activeCollab
installation. This should include the
trailing slash.
Output: none
\*======================================================================*/
public function setBaseURL($acBaseURL)
{
$this->Objects->setBaseURL($acBaseURL);
$this->Tickets->setBaseURL($acBaseURL);
}
/*======================================================================*\
Function: setUserAPIKey
Purpose: Set the user API key.
Input: $userAPIKey the API key that the class should use.
Output: none
\*======================================================================*/
public function setUserAPIKey($userAPIKey)
{
$this->Objects->setUserAPIKey($userAPIKey);
$this->Tickets->setUserAPIKey($userAPIKey);
}
}
?>