This repository was archived by the owner on Feb 25, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +401
-0
lines changed
Expand file tree Collapse file tree 2 files changed +401
-0
lines changed Original file line number Diff line number Diff line change 1+ Library to use parse.com rest API.
2+ More on the api here: https://www.parse.com/docs/rest
3+
4+ Some examples on how to use this library:
5+
6+
7+ //
8+ // CREATE OBJECT
9+ //
10+
11+ $parse = new parseRestClient(array(
12+ 'appid' => 'YOUR APPLICATION ID',
13+ 'masterkey' => 'YOUR MASTER KEY ID'
14+ ));
15+
16+
17+ //
18+ // CREATE EXAMPLE
19+ //
20+ $params = array(
21+ 'className' => 'gameScore',
22+ 'object' => array(
23+ 'score' => 500,
24+ 'name' => 'Andrew Scofield'
25+ )
26+ );
27+
28+ $request = $parse->create($params);
29+
30+
31+ //
32+ // GET EXAMPLE
33+ //
34+
35+ $params = array(
36+ 'className' => 'gameScore',
37+ 'objectId' => 'Ed1nuqPvcm'
38+ );
39+
40+ $request = $parse->get($params);
41+
42+
43+ //
44+ //QUERY EXAMPLE
45+ //
46+
47+ $params = array(
48+ 'className' => 'gameScore',
49+ 'query' => array(
50+ 'score'=> array(
51+ '$gt' => 500
52+ )
53+ ),
54+ 'order' => '-score',
55+ 'limit' => '2',
56+ 'skip' => '2'
57+ );
58+
59+ $request = $parse->query($params);
60+
61+
62+ //
63+ // UPDATE EXAMPLE
64+ //
65+
66+ $params = array(
67+ 'className' => 'gameScore',
68+ 'objectId' => 'Ed1nuqPvcm',
69+ 'object' => array(
70+ 'score' => 500,
71+ 'name' => 'Andrew Scofield'
72+ )
73+ );
74+
75+ $request = $parse->update($params);
76+
77+
78+ //
79+ // DELETE EXAMPLE
80+ //
81+
82+ $params = array(
83+ 'className' => 'gameScore',
84+ 'objectId' => 'Ed1nuqPvcm',
85+ );
86+
87+ $request = $parse->delete($params);
88+
89+
You can’t perform that action at this time.
0 commit comments