You are here

public function SocialTaggingService::hasContent in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  2. 8.2 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  3. 8.3 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  4. 8.4 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  5. 8.5 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  6. 8.6 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  7. 8.7 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  8. 8.8 modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  9. 10.3.x modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  10. 10.0.x modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  11. 10.1.x modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()
  12. 10.2.x modules/social_features/social_tagging/src/SocialTaggingService.php \Drupal\social_tagging\SocialTaggingService::hasContent()

Returns if there are any taxonomy items available.

Return value

bool If there are tags available.

File

modules/social_features/social_tagging/src/SocialTaggingService.php, line 60

Class

SocialTaggingService
Provides a custom tagging service.

Namespace

Drupal\social_tagging

Code

public function hasContent() {
  if (count($this
    ->getCategories()) == 0) {
    return FALSE;
  }
  if (count($this
    ->getAllChildren()) == 0) {
    return FALSE;
  }
  return TRUE;
}