More on the parse.com api here: https://www.parse.com/docs/rest
Availalbe here: https://github.com/apotropaic/parse.com-php-library/blob/1.0/master/README.md
I wrote tests not for testing sake, but really just to see how I liked how the library worked!
This is a work in progress and is a drasticly different then v1 of this library.
Let me know what you think and suggestions and ideas
Instructions after cloning this repository you have to create a file in the root of it called parseConfig.php
Below is what you want parseConfig.php to look like, just fill in your IDs and KEYs to get started.
<?php
class parseConfig{
const APPID = '';
const MASTERKEY = '';
const RESTKEY = '';
const PARSEURL = 'https://api.parse.com/1/';
}
?>
An example to create and store a new object of class "MyClass".
<?php
$object = new parseObject('MyClass');
$object->name = "Foobar";
$object->description = "The term 'Foobar' is just a placeholder name";
$object->save();
?>
Retrieve all objects of a Class-name An example to retrieve all objects of 'MyClass'. The query is limited to 1000 objects per request (parse limit).
<?php
$object = new parseQuery('MyClass');
$object->find();
Add conditions to retrieve objects An example to retrieve all objects of 'MyClass' and add some conditions to the query. Let's say we have a class (MyClass) with following properties:
- name
- description
- status
- author
- createdAt
- updatedAt
<?php
$object = new parseQuery('MyClass');
$object->where('status', 1); // retrieve objects where status = 1 (EqualTo)
$object->where('author', "nico"); // retrieve objects where author = "nico"
$object->orderByAscending('name'); // order the items by "name" ASC
$object->setLimit(100); // Limit the retieved data by the first 100 objects.
$data = $object->find();