parse.com-php-library icon indicating copy to clipboard operation
parse.com-php-library copied to clipboard

parseObject suggestion

Open jobrienski opened this issue 13 years ago • 6 comments
trafficstars


       public function __get($name) {
                if($name != '_className'){
                        return $this->data[$name];
                }
                return NULL;
        }

jobrienski avatar Sep 05 '12 03:09 jobrienski

Actually might not need the if statement

jobrienski avatar Sep 05 '12 03:09 jobrienski

How would this be used on the developer end?

andrewscofield avatar Sep 05 '12 04:09 andrewscofield

Well, for example, if you set data, you can retrieve it like you would after you retrieved an object from the parse library:

$test = new parseObject('test');
$test->name  = "jim";
echo "Name is: " . $test->name . "\n";

jobrienski avatar Sep 05 '12 04:09 jobrienski

It would be nice also if after you saved an object, the objectId would be populated in the object:

$test->save();
echo "Saved with object id: " . $test->objectId . "\n";

jobrienski avatar Sep 05 '12 04:09 jobrienski

Oh ok, I get it now. Yea I'll implement this is a good idea.

I have been trying to think up a good way to make things flow a little better like for example having the objectId readily available after a save. For now you can capture $test->save() into a variable to get the return from parse. Or for example after performing a parseObject->save() you can then do parseObject->get() without having to initiate it in another variable.

I'm just now sure how to do it all yet :). Maybe version 2.1 will have this stuff :)

andrewscofield avatar Sep 05 '12 05:09 andrewscofield

Cool, sounds good. I definitely like it alot better. -jim

On Tue, Sep 4, 2012 at 10:25 PM, apotropaic [email protected]:

Oh ok, I get it now. Yea I'll implement this is a good idea.

I have been trying to think up a good way to make things flow a little better like for example having the objectId readily available after a save. For now you can capture $test->save() into a variable to get the return from parse. Or for example after performing a parseObject->save() you can then do parseObject->get() without having to initiate it in another variable.

I'm just now sure how to do it all yet :). Maybe version 2.1 will have this stuff :)

— Reply to this email directly or view it on GitHubhttps://github.com/apotropaic/parse.com-php-library/issues/40#issuecomment-8288059.

jobrienski avatar Sep 05 '12 05:09 jobrienski