From 03a3b248541f84da6e47b638533e9581b0ea5069 Mon Sep 17 00:00:00 2001 From: Tim Plunkett <git@plnktt.com> Date: Wed, 12 Sep 2012 22:51:18 -0400 Subject: [PATCH] Issue #1727266 by tim.plunkett: Move PluginBase::getTypes() to View::getPluginTypes(). --- lib/Drupal/views/Plugin/views/PluginBase.php | 30 -------------------- lib/Drupal/views/View.php | 30 ++++++++++++++++++++ lib/Drupal/views/ViewsBundle.php | 4 +-- views.module | 3 +- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/lib/Drupal/views/Plugin/views/PluginBase.php b/lib/Drupal/views/Plugin/views/PluginBase.php index f236b497f2a2..ba5640976852 100644 --- a/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/lib/Drupal/views/Plugin/views/PluginBase.php @@ -51,36 +51,6 @@ public function __construct(array $configuration, $plugin_id, DiscoveryInterface $this->construct(); } - /** - * Returns the valid types of plugins that can be used. - * - * @return array - * An array of plugin type strings. - */ - public static function getTypes() { - return array( - 'access', - 'area', - 'argument', - 'argument_default', - 'argument_validator', - 'cache', - 'display_extender', - 'display', - 'exposed_form', - 'field', - 'filter', - 'join', - 'pager', - 'query', - 'relationship', - 'row', - 'sort', - 'style', - 'wizard', - ); - } - /** * Information about options for all kinds of purposes will be held here. * @code diff --git a/lib/Drupal/views/View.php b/lib/Drupal/views/View.php index fcba53e5ac82..3d6b3b77cb4f 100644 --- a/lib/Drupal/views/View.php +++ b/lib/Drupal/views/View.php @@ -2067,6 +2067,36 @@ public function isTranslatable() { return (!isset($this->type) || in_array($this->type, array(t('Normal'), t('Overridden')))) ? TRUE : FALSE; } + /** + * Returns the valid types of plugins that can be used. + * + * @return array + * An array of plugin type strings. + */ + public static function getPluginTypes() { + return array( + 'access', + 'area', + 'argument', + 'argument_default', + 'argument_validator', + 'cache', + 'display_extender', + 'display', + 'exposed_form', + 'field', + 'filter', + 'join', + 'pager', + 'query', + 'relationship', + 'row', + 'sort', + 'style', + 'wizard', + ); + } + /** * Provide a list of views handler types used in a view, with some information * about them. diff --git a/lib/Drupal/views/ViewsBundle.php b/lib/Drupal/views/ViewsBundle.php index 6342662fcf23..58ccc83b9a4d 100644 --- a/lib/Drupal/views/ViewsBundle.php +++ b/lib/Drupal/views/ViewsBundle.php @@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; -use Drupal\views\Plugin\views\PluginBase; +use Drupal\views\View; /** * Views dependency injection container. @@ -20,7 +20,7 @@ class ViewsBundle extends Bundle { * Overrides Symfony\Component\HttpKernel\Bundle\Bundle::build(). */ public function build(ContainerBuilder $container) { - foreach (PluginBase::getTypes() as $type) { + foreach (View::getPluginTypes() as $type) { $container->register("plugin.manager.views.$type", 'Drupal\views\Plugin\Type\ViewsPluginManager') ->addArgument($type); } diff --git a/views.module b/views.module index ace1cf1de836..fb49705a1321 100644 --- a/views.module +++ b/views.module @@ -12,7 +12,6 @@ use Drupal\Core\Database\Query\AlterableInterface; use Drupal\views\TempStore\UserTempStore; use Drupal\views\View; -use Drupal\views\Plugin\views\PluginBase; use Drupal\Component\Plugin\Exception\PluginException; /** @@ -1427,7 +1426,7 @@ function views_get_plugin($type, $plugin_id) { */ function views_get_plugin_definitions($type = FALSE) { $plugins = array(); - $plugin_types = $type ? array($type) : PluginBase::getTypes(); + $plugin_types = $type ? array($type) : View::getPluginTypes(); $container = drupal_container(); foreach ($plugin_types as $plugin_type) { $plugins[$plugin_type] = $container->get("plugin.manager.views.$plugin_type")->getDefinitions(); -- GitLab