forked from Pollenizer/CakePHP-MakePlans-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
80 lines (62 loc) · 1.89 KB
/
README
File metadata and controls
80 lines (62 loc) · 1.89 KB
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
MakePlans Plugin
A CakePHP Plugin for interfacing with the MakePlans Web Service via a Datasource
http://www.makeplans.net/api/
INSTALLATION
------------
Install the plugin in the app/Plugin/MakePlans directory and insert the
following line into bootstrap.php
CakePlugin::load('MakePlans');
CONFIGURATION
-------------
1. Add the following to app/Config/database.php:
public $makePlans = array (
'datasource' => 'MakePlans.MakePlansSource',
'apikey' => 'APIKEY',
'account' => 'ACCOUNT',
);
2. Add the following to your model:
public $useDbConfig = 'makePlans';
public $useTable = false;
USAGE
-----
The following example shows how to retrieve a MakePlans resource:
$data = $this->Model->resource(array(
'id' => 43,
'backend' => true,
)
);
Get available bookings slots:
$data = $this->Model->bookings(array(
'query' => array (
'service' => 28,
'selected_resources' => 84,
'from' => '2012-02-20',
)
)
);
Update a resource:
$data = $this->Model->resource(array(
'method' => 'PUT',
'id' => 43,
'backend' => true,
'body' => array (
'resource' => array (
'open_0' => '19:30',
'close_0' => '23:00',
'open_1' => null,
'close_1' => null,
'open_2' => null,
'close_2' => null,
'open_3' => '09:00',
'close_3' => '10:00',
'open_4' => null,
'close_4' => null,
'open_5' => null,
'close_5' => null,
'open_6' => null,
'close_6' => null,
'id' => 43,
)
),
)
);