Skip to content

Making ParseUser and ParseRole subclassable #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2015

Conversation

hipsterjazzbo
Copy link
Contributor

This makes a few adjustments to make ParseUser and ParseRole subclassable.

Most of the changes are pretty self-explanitory, however a note about the ParseObject::getRegisteredSubclass() method: This is very useful to be able to dynamically retrieve the correct registered subclass for a given Parse class. I'm using this method in my Laravel integration package to provide authentication drivers, among other things.

This PR addresses #42.

Thanks!

@hipsterjazzbo
Copy link
Contributor Author

Sorry, one more note: these changes would enable you to easily make ParseSession subclassable as well, although I'm not if there is any utility in that.

@@ -90,7 +90,7 @@ public function isAuthenticated()
/**
* Signs up the current user, or throw if invalid.
* This will create a new ParseUser on the server, and also persist the
* session so that you can access the user using ParseUser::getCurrentUser();.
* session so that you can access the user using static::getCurrentUser();.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not change this function comment.. it's not valid outside of the class. Those who are subclassing can use their classname interchangeably... but it also looks like ParseUser::getCurrentUser() would return the subclassed version as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. I'll fix that now.

@gfosco
Copy link
Contributor

gfosco commented Apr 2, 2015

If you can address the comment I made and rebase, I'll look at merging it. Still need to have a conversation internally, because we're looking at fixing this in another SDK and want to make sure it is consistent.

@gfosco gfosco mentioned this pull request Apr 2, 2015
@hipsterjazzbo
Copy link
Contributor Author

@gfosco Done

gfosco added a commit that referenced this pull request Apr 15, 2015
Making ParseUser and ParseRole subclassable
@gfosco gfosco merged commit 00d40dd into parse-community:master Apr 15, 2015
@gfosco
Copy link
Contributor

gfosco commented Apr 15, 2015

I should've merged this before tagging 1.1.1... Oh well, I'll merge this now. Thanks HipsterJazzbo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants