Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created July 3, 2014 12:52
Show Gist options
  • Save niraj-shah/a6d3b33b64101890edfb to your computer and use it in GitHub Desktop.
Save niraj-shah/a6d3b33b64101890edfb to your computer and use it in GitHub Desktop.
Parse.com PHP SDK - DataType Examples
<?php
// string dataType
$parse->bio = "I am a PHP developer";
// number dataType
$parse->age = 29;
// pointer to User class
$parse->userId = $parse->dataType( 'pointer', array( '_User', $user_id ) );
// pointer to custom class
$parse->profilePic = $parse->dataType( 'pointer', array( 'ProfilePic', 'lq8MSiynEh' ) );
// date dataType
$parse->dob = $parse->dataType( 'date', '1985-01-01' );
// geopoint dataType, in form array( lat, lon )
$parse->location = $parse->dataType( 'geopoint', array( '51.50269506659542', '-0.12497629859615969' ) );
// array dataType - standard PHP array
$parse->hobbies = array( 'Video Games', 'Table Tennis', 'Squash' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment