diff --git a/src/MembershipManager.php b/src/MembershipManager.php index 26391a067..ad106fa85 100644 --- a/src/MembershipManager.php +++ b/src/MembershipManager.php @@ -63,7 +63,7 @@ public function __construct(EntityTypeManagerInterface $entity_type_manager, OgG * {@inheritdoc} */ public function getUserGroupIds($user_id, array $states = [OgMembershipInterface::STATE_ACTIVE]) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -82,7 +82,7 @@ public function getUserGroupIds($user_id, array $states = [OgMembershipInterface * {@inheritdoc} */ public function getUserGroups($user_id, array $states = [OgMembershipInterface::STATE_ACTIVE]) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -95,7 +95,7 @@ public function getUserGroups($user_id, array $states = [OgMembershipInterface:: * {@inheritdoc} */ public function getMemberships($user_id, array $states = [OgMembershipInterface::STATE_ACTIVE]) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -130,7 +130,7 @@ public function getMemberships($user_id, array $states = [OgMembershipInterface: * {@inheritdoc} */ public function getMembership(EntityInterface $group, $user_id, array $states = [OgMembershipInterface::STATE_ACTIVE]) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -149,7 +149,7 @@ public function getMembership(EntityInterface $group, $user_id, array $states = * {@inheritdoc} */ public function getUserGroupIdsByRoleIds($user_id, array $role_ids, array $states = [OgMembershipInterface::STATE_ACTIVE], bool $require_all_roles = TRUE): array { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -172,7 +172,7 @@ public function getUserGroupIdsByRoleIds($user_id, array $role_ids, array $state * {@inheritdoc} */ public function getUserGroupsByRoleIds($user_id, array $role_ids, array $states = [OgMembershipInterface::STATE_ACTIVE], bool $require_all_roles = TRUE): array { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -415,7 +415,7 @@ public function getGroupContentIds(EntityInterface $entity, array $entity_types * {@inheritdoc} */ public function isMember(EntityInterface $group, $user_id, array $states = [OgMembershipInterface::STATE_ACTIVE]) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -429,7 +429,7 @@ public function isMember(EntityInterface $group, $user_id, array $states = [OgMe * {@inheritdoc} */ public function isMemberPending(EntityInterface $group, $user_id) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); } @@ -441,7 +441,7 @@ public function isMemberPending(EntityInterface $group, $user_id) { * {@inheritdoc} */ public function isMemberBlocked(EntityInterface $group, $user_id) { - if (!is_int($user_id)) { + if ($user_id instanceof AccountInterface) { trigger_error('Passing an account object is deprecated in og:8.1.0-alpha4 and is removed from og:8.1.0-beta1. Instead pass the user ID as an integer value. See https://github.com/Gizra/og/issues/542', E_USER_DEPRECATED); $user_id = $user_id->id(); }