You are here

class FooTable in FooTable 8.2

Same name in this branch
  1. 8.2 src/FooTable.php \Drupal\footable\FooTable
  2. 8.2 src/Element/FooTable.php \Drupal\footable\Element\FooTable
  3. 8.2 src/Plugin/views/style/FooTable.php \Drupal\footable\Plugin\views\style\FooTable

Hierarchy

Expanded class hierarchy of FooTable

4 string references to 'FooTable'
footable.info.yml in ./footable.info.yml
footable.info.yml
footable.links.menu.yml in ./footable.links.menu.yml
footable.links.menu.yml
footable.routing.yml in ./footable.routing.yml
footable.routing.yml
footable.services.yml in ./footable.services.yml
footable.services.yml
1 service uses FooTable
footable.footable in ./footable.services.yml
Drupal\footable\FooTable

File

src/FooTable.php, line 11

Namespace

Drupal\footable
View source
class FooTable implements FooTableInterface {

  /**
   * The FooTable breakpoint storage.
   *
   * @var \Drupal\Core\Entity\ContentEntityStorageInterface
   */
  protected $breakpointStorage;

  /**
   * The FooTable config.
   *
   * @var \Drupal\Core\Config\Config
   */
  protected $config;

  /**
   * Constructs a FooTable object.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
   *   The entity type manager.
   * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
   *   The config factory.
   */
  public function __construct(EntityTypeManagerInterface $entityTypeManager, ConfigFactoryInterface $configFactory) {
    $this->breakpointStorage = $entityTypeManager
      ->getStorage('footable_breakpoint');
    $this->config = $configFactory
      ->get('footable.settings');
  }

  /**
   * {@inheritdoc}
   */
  public function getLibrary() {
    $library = $this->config
      ->get('plugin_type') . '_' . $this->config
      ->get('plugin_compression');
    return 'footable/footable_' . $library;
  }

  /**
   * {@inheritdoc}
   */
  public function getBreakpoints() {
    $breakpoints = [];

    /* @var \Drupal\footable\Entity\FooTableBreakpointInterface $breakpoint */
    foreach ($this->breakpointStorage
      ->loadMultiple() as $breakpoint) {
      $breakpoints[$breakpoint
        ->id()] = $breakpoint
        ->getBreakpoint();
    }
    return $breakpoints;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FooTable::$breakpointStorage protected property The FooTable breakpoint storage.
FooTable::$config protected property The FooTable config.
FooTable::getBreakpoints public function Overrides FooTableInterface::getBreakpoints
FooTable::getLibrary public function Overrides FooTableInterface::getLibrary
FooTable::__construct public function Constructs a FooTable object.