You are here

CalendarEventStorage.php in Opigno calendar event 3.x

Same filename and directory in other branches
  1. 8 src/CalendarEventStorage.php

File

src/CalendarEventStorage.php
View source
<?php

namespace Drupal\opigno_calendar_event;

use Drupal\Core\Entity\Sql\SqlContentEntityStorage;

/**
 * Storage class for calendar events.
 */
class CalendarEventStorage extends SqlContentEntityStorage {

  /**
   * Checks whether there is stored data for the specififed bundle.
   *
   * @param string $bundle_id
   *   The bundle ID.
   *
   * @return bool
   *   TRUE if there is stored data for the specified bundle, FALSE otherwise.
   */
  public function hasBundleData($bundle_id) {
    $bundle_key = $this
      ->getEntityType()
      ->getKey('bundle');
    return (bool) $this
      ->getQuery()
      ->accessCheck(FALSE)
      ->condition($bundle_key, $bundle_id)
      ->range(0, 1)
      ->execute();
  }

}

Classes

Namesort descending Description
CalendarEventStorage Storage class for calendar events.