Skip to content

nheulsen/parse.com-php-library

 
 

Repository files navigation

PHP parse.com API library

More on the parse.com api here: https://www.parse.com/docs/rest

V1 is still avaialble

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!

Feedback Wanted

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

SETUP

Instructions after cloning this repository you have to create a file in the root of it called parseConfig.php

sample of 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/';
}

?>

Examples

parseObject

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();

?>

parseQuery

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();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%