SocialEventEnrollService.php in Open Social 8.7
Same filename and directory in other branches
- 8.9 modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 8.5 modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 8.6 modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 8.8 modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 10.3.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 10.0.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 10.1.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php
- 10.2.x modules/social_features/social_event/src/Service/SocialEventEnrollService.php
Namespace
Drupal\social_event\ServiceFile
modules/social_features/social_event/src/Service/SocialEventEnrollService.phpView source
<?php
namespace Drupal\social_event\Service;
use Drupal\node\NodeInterface;
/**
* Class SocialEventEnrollService.
*
* @package Drupal\social_event\Service
*/
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;
}
}
Classes
Name | Description |
---|---|
SocialEventEnrollService | Class SocialEventEnrollService. |