FooTable.php in FooTable 8.2
File
src/FooTable.php
View source
<?php
namespace Drupal\footable;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
class FooTable implements FooTableInterface {
protected $breakpointStorage;
protected $config;
public function __construct(EntityTypeManagerInterface $entityTypeManager, ConfigFactoryInterface $configFactory) {
$this->breakpointStorage = $entityTypeManager
->getStorage('footable_breakpoint');
$this->config = $configFactory
->get('footable.settings');
}
public function getLibrary() {
$library = $this->config
->get('plugin_type') . '_' . $this->config
->get('plugin_compression');
return 'footable/footable_' . $library;
}
public function getBreakpoints() {
$breakpoints = [];
foreach ($this->breakpointStorage
->loadMultiple() as $breakpoint) {
$breakpoints[$breakpoint
->id()] = $breakpoint
->getBreakpoint();
}
return $breakpoints;
}
}