amitaibu / og

A fork to work on OG8
https://github.com/Gizra/og
29 stars 16 forks source link

Move Og::getRole() to OgRole #292

Closed pfrenssen closed 7 years ago

pfrenssen commented 7 years ago

We have a convenient static method that allows to retrieve an OgRole by group entity type, bundle and role name: Og::getRole().

This method should be moved out of the Og class. It belongs in OgRole, because it is closely related to OgRole::load(), 'OgRole::loadMultiple()andOgRole::loadByGroupAndName()`.

We should rename it as well, so it starts with load...(). Any suggestions for a good name?

pfrenssen commented 7 years ago

Best I can come up with right now is OgRole::loadByGroupTypeGroupBundleAndName() but this is a bit :unamused:

golddragon007 commented 7 years ago

I did it: https://github.com/amitaibu/og/pull/306 I'm at Drupalaton codesprint.

Unfortunately I can't find better name for it, except if we create a 'magic' function which works like the method overload...

dakala commented 7 years ago

https://github.com/Gizra/og/pull/167 ready for review