diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php index 7826384..c98066f 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php @@ -7,13 +7,12 @@ namespace Drupal\aggregator\Form; +use Drupal\aggregator\ItemStorageControllerInterface; use Drupal\Component\Utility\String; use Drupal\Core\Config\Config; use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Database\Connection; -use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityRenderControllerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -44,11 +43,11 @@ class AggregatorCategoryForm implements FormInterface, ControllerInterface { protected $database; /** - * The module handler. + * The aggregator item storage controller. * - * @var \Drupal\Core\Extension\ModuleHandlerInterface + * @var \Drupal\aggregator\ItemStorageControllerInterface */ - protected $moduleHandler; + protected $storageController; /** * Constructs a \Drupal\aggregator\Controller\AggregatorController object. @@ -59,14 +58,15 @@ class AggregatorCategoryForm implements FormInterface, ControllerInterface { * The database connection. * @param \Drupal\Core\Config\Config $config * The aggregator config. - * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler - * The module handler. + * @param \Drupal\aggregator\ItemStorageControllerInterface $storage_controller + * The aggregator item storage controller. + * @internal param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler The module handler.* The module handler. */ - public function __construct(EntityRenderControllerInterface $render_controller, Connection $database, Config $config, ModuleHandlerInterface $module_handler) { + public function __construct(EntityRenderControllerInterface $render_controller, Connection $database, Config $config, ItemStorageControllerInterface $storage_controller) { $this->renderController = $render_controller; $this->database = $database; $this->config = $config; - $this->moduleHandler = $module_handler; + $this->storageController = $storage_controller; } /** @@ -77,7 +77,7 @@ public static function create(ContainerInterface $container) { $container->get('plugin.manager.entity')->getRenderController('aggregator_item'), $container->get('database'), $container->get('config.factory')->get('aggregator.settings'), - $container->get('module_handler') + $container->get('plugin.manager.entity')->getStorageController('aggregator_item') ); } @@ -92,14 +92,7 @@ public function getFormID() { * {@inheritdoc} */ public function buildForm(array $form, array &$form_state, $category = NULL) { - $this->moduleHandler->loadInclude('aggregator', 'inc', 'aggregator.pages'); - // @todo Remove once categories are taxonomy terms - see - // https://drupal.org/node/15266. - $category = aggregator_category_load($category); - // @todo Remove once aggregator_load_feed_items() is a method on the - // \Drupal\aggregator\ItemStorageController, see - // https://drupal.org/node/2043581 - $items = aggregator_load_feed_items('category', $category); + $items = $this->storageController->loadByCategory($category); $form['feed_source'] = array( '#value' => '', );