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
Moved global PAGE_* to Profile class #5500
Moved global PAGE_* to Profile class #5500
Conversation
I don't think that "profile" is the correct class. It belongs to the user. Additionally I prefer if you would move the "ACCOUNT_TYPE_" constants as well, since they belong to these "PAGE_" constants. |
@MrPetovan told me to do so. |
A user can have multiple profiles. But these types are assigned to the user table, not the profile table. Update: Possibly the Contact class is even better, since we use this constant in combination with the contact table as well. |
My mistake, I saw that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constants should be in Model\User
instead, I'm sorry about that.
It is okay. Will do it tomorrow. |
Or it is |
Do we use it the same exact way? Does it count for non-Friendica contacts? |
It is used in the same way. It is in I'm unsure if DFRN would be ideal? But when we possibly switch to AP, we surely would transmit this over there as well. |
I think there should be a distinction between both, and we should have a copy of the constants in |
I think this duplication would confuse even more, since we fill the user constant on the sender side and use it with the contact constant on the receiver side. |
In this case I would put it in |
One hour ago was the last comment, then I presume that |
I'm fine with it. But please also add this second group of constants I mentioned, since they are some kind of subgroup. |
3deddd6
to
0097f85
Compare
Done as requested and rebased branch against |
src/Model/Contact.php
Outdated
* This will only be assigned to contacts, not to user accounts | ||
* @{ | ||
*/ | ||
define('ACCOUNT_TYPE_PERSON', 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the wrong syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over-heat problem detected. ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…\Models\Profile class
- moved all PAGE_* constants to Friendica\Model\Contact class - fixed all references of both classes
- moved ACCOUNT_TYPE_* constants from boot.php to Contact::ACCOUNT_TYPE_*
…st ACCOUNT_TYPE_FOO = x;`
0097f85
to
c03828d
Compare
Oh, again. :-( |
This PR is similar to #5490 and moves all
PAGE_*
(global namespace) toFriendica\Model\Profile
class. There is also one addon (forumdirectory
) that needs change (already done, PR will depend on this).