-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
42 lines (31 loc) · 1.07 KB
/
index.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
<?php
require_once 'KinveyREST.php';
require_once 'debug.php';
/**
* Init class
*/
use KinveyREST\KinveyREST;
$kinveyRest = New KinveyREST();
/**
* Get users
*/
$users = $kinveyRest->users(null, null, array('fields' => array('name', 'email', '_id')));
/**
* Retrieve
*/
$data = $kinveyRest->retrieve('Albums',
'',
array(),
array('sort' => array('_kmd.lmt' => -1),
'limit' => 2),
array('pictures'), true/* Convert result to json */);
/**
* Creating
*/
$today = new \DateTime('now');
$kinveyDataFormat = $today->format(\DateTime::ATOM); // Kinvey data format
$data = $kinveyRest->create("TodoList", array('task' => 'Create CRUD',
'done' => false,
'complexity' => 2,
'expirationAt' => $kinveyDataFormat,
'_acl' => array('creator' => '53a320d1c71d0b672103d014') /*If you need to save the register to a specified owner - user_id like 53a320d1c71d0b672103d014*/), true);