Created
July 3, 2014 12:52
-
-
Save niraj-shah/a6d3b33b64101890edfb to your computer and use it in GitHub Desktop.
Parse.com PHP SDK - DataType Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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