Closed amitaibu closed 8 years ago
We now have:
$membership = OgMembership::create(['type' => OgMembershipInterface::TYPE_DEFAULT]); $membership ->setUser($user->id()) ->setEntityId($group->id()) ->setGroupEntityType($group->getEntityTypeId()) ->save();
but we could improve this (confusingly named) setEntityId and setGroupEntityType and have SetGroup($group) instead. Also those method should get the full object not just the ID:
setEntityId
setGroupEntityType
SetGroup($group)
$membership = OgMembership::create(['type' => OgMembershipInterface::TYPE_DEFAULT]); $membership ->setUser($user) ->setGroup($group) ->save();
Also setting the roles can get an array of roles objects not just Ids:
->setRoles([$og_role->id()])
Would become:
->setRoles([$og_role1])
I'll take this one.
We now have:
but we could improve this (confusingly named)
setEntityId
andsetGroupEntityType
and haveSetGroup($group)
instead. Also those method should get the full object not just the ID: