You are here

class SocialEventEnrollService in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  2. 8.5 modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  3. 8.7 modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  4. 8.8 modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  5. 10.3.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  6. 10.0.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  7. 10.1.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService
  8. 10.2.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php \Drupal\social_event\Service\SocialEventEnrollService

Class SocialEventEnrollService.

@package Drupal\social_event\Service

Hierarchy

Expanded class hierarchy of SocialEventEnrollService

1 string reference to 'SocialEventEnrollService'
social_event.services.yml in modules/social_features/social_event/social_event.services.yml
modules/social_features/social_event/social_event.services.yml
1 service uses SocialEventEnrollService
social_event.enroll in modules/social_features/social_event/social_event.services.yml
Drupal\social_event\Service\SocialEventEnrollService

File

modules/social_features/social_event/src/Service/SocialEventEnrollService.php, line 12

Namespace

Drupal\social_event\Service
View source
class SocialEventEnrollService implements SocialEventEnrollServiceInterface {

  /**
   * {@inheritdoc}
   */
  public function isEnabled(NodeInterface $node) {
    if ($node
      ->bundle() === 'event' && $node
      ->hasField('field_event_enroll')) {
      $was_not_changed = $node->field_event_enroll
        ->isEmpty();
      $is_enabled = $node->field_event_enroll->value;
      return $was_not_changed || $is_enabled;
    }
    return FALSE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SocialEventEnrollService::isEnabled public function Check if enrollment is allowed for given event. Overrides SocialEventEnrollServiceInterface::isEnabled