class EventAnEnrollManager in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 8.5 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 8.6 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 8.7 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 8.8 modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 10.3.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 10.1.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
- 10.2.x modules/social_features/social_event/modules/social_event_an_enroll/src/EventAnEnrollManager.php \Drupal\social_event_an_enroll\EventAnEnrollManager
Class EventAnEnrollManager.
Hierarchy
- class \Drupal\social_event_an_enroll\EventAnEnrollManager uses StringTranslationTrait
Expanded class hierarchy of EventAnEnrollManager
4 files declare their use of EventAnEnrollManager
- EnrolmentUserDisplayName.php in modules/
social_features/ social_event/ modules/ social_event_an_enroll_enrolments_export/ src/ Plugin/ UserExportPlugin/ EnrolmentUserDisplayName.php - ExportAllEnrolments.php in modules/
social_features/ social_event/ modules/ social_event_an_enroll_enrolments_export/ src/ Plugin/ Action/ ExportAllEnrolments.php - SocialEventAnEnrollSendEmail.php in modules/
social_features/ social_event/ modules/ social_event_an_enroll/ src/ Plugin/ Action/ SocialEventAnEnrollSendEmail.php - SocialEventAnEnrollViewsBulkOperationsBulkForm.php in modules/
social_features/ social_event/ modules/ social_event_an_enroll/ src/ Plugin/ views/ field/ SocialEventAnEnrollViewsBulkOperationsBulkForm.php
1 string reference to 'EventAnEnrollManager'
- social_event_an_enroll.services.yml in modules/
social_features/ social_event/ modules/ social_event_an_enroll/ social_event_an_enroll.services.yml - modules/social_features/social_event/modules/social_event_an_enroll/social_event_an_enroll.services.yml
1 service uses EventAnEnrollManager
- social_event_an_enroll.manager in modules/
social_features/ social_event/ modules/ social_event_an_enroll/ social_event_an_enroll.services.yml - \Drupal\social_event_an_enroll\EventAnEnrollManager
File
- modules/
social_features/ social_event/ modules/ social_event_an_enroll/ src/ EventAnEnrollManager.php, line 11
Namespace
Drupal\social_event_an_enrollView source
class EventAnEnrollManager {
use StringTranslationTrait;
/**
* Returns guest name.
*
* @param \Drupal\social_event\EventEnrollmentInterface $entity
* The event enrollment.
* @param bool $email
* TRUE if can show E-mail address when first and last names is not set.
*
* @return string
* Full name or E-mail address.
*/
public function getGuestName(EventEnrollmentInterface $entity, $email = TRUE) {
$parts = [];
// If user doesn't have access to see the first/last/email value.
// Lets return guest.
if (!social_event_manager_or_organizer()) {
return $this
->t('Guest');
}
if (!$entity->field_first_name
->isEmpty()) {
$parts[] = $entity->field_first_name->value;
}
if (!$entity->field_last_name
->isEmpty()) {
$parts[] = $entity->field_last_name->value;
}
if (!$parts && $email) {
$parts[] = $entity->field_email->value;
}
return implode(' ', $parts);
}
/**
* Check if enrollment user is guest.
*
* @param \Drupal\social_event\EventEnrollmentInterface $entity
* The event enrollment.
*
* @return bool
* TRUE if it is guest.
*/
public function isGuest(EventEnrollmentInterface $entity) {
return !$entity->field_account->target_id;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EventAnEnrollManager:: |
public | function | Returns guest name. | |
EventAnEnrollManager:: |
public | function | Check if enrollment user is guest. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |