/** * Checks that user is not "myself" or is not blocked by notification target user */ public function isNotMyselfOrBlockedByReceiver(User $sourceUser, User $targetUser) { if ($targetUser->getKey() != $sourceUser->getKey() && !$targetUser->isBlockingUser($sourceUser)) { return true; } return false; }