You are here

class DashboardService in Content Planner 8

Class DashboardService.

Hierarchy

Expanded class hierarchy of DashboardService

1 file declares its use of DashboardService
DashboardController.php in src/Controller/DashboardController.php
1 string reference to 'DashboardService'
content_planner.services.yml in ./content_planner.services.yml
content_planner.services.yml
1 service uses DashboardService
content_planner.dashboard_service in ./content_planner.services.yml
Drupal\content_planner\DashboardService

File

src/DashboardService.php, line 8

Namespace

Drupal\content_planner
View source
class DashboardService {

  /**
   * The dashboard settings service.
   *
   * @var \Drupal\content_planner\DashboardSettingsService
   */
  protected $dashboardSettingsService;

  /**
   * Constructs a new DashboardService object.
   */
  public function __construct(DashboardSettingsService $dashboard_settings_service) {
    $this->dashboardSettingsService = $dashboard_settings_service;
  }

  /**
   * Gets the dashboard settings.
   *
   * @return \Drupal\Core\Config\ImmutableConfig
   *   The current dashboard config.
   */
  public function getDashboardSettings() {
    return $this->dashboardSettingsService
      ->getSettings();
  }

  /**
   * Check if the Content Calendar is enabled.
   *
   * @return bool
   *   TRUE if the content calendar is enabled.
   */
  public function isContentCalendarEnabled() {
    return \Drupal::moduleHandler()
      ->moduleExists('content_calendar');
  }

  /**
   * Check if the Content Kanban is enabled.
   *
   * @return bool
   *   TRUE if the kanban calendar is enabled.
   */
  public function isContentKanbanEnabled() {
    return \Drupal::moduleHandler()
      ->moduleExists('content_kanban');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DashboardService::$dashboardSettingsService protected property The dashboard settings service.
DashboardService::getDashboardSettings public function Gets the dashboard settings.
DashboardService::isContentCalendarEnabled public function Check if the Content Calendar is enabled.
DashboardService::isContentKanbanEnabled public function Check if the Content Kanban is enabled.
DashboardService::__construct public function Constructs a new DashboardService object.