interface ViewsHandlerInterface

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/ViewsHandlerInterface.php \Drupal\views\Plugin\views\ViewsHandlerInterface
  2. 10 core/modules/views/src/Plugin/views/ViewsHandlerInterface.php \Drupal\views\Plugin\views\ViewsHandlerInterface
  3. 11.x core/modules/views/src/Plugin/views/ViewsHandlerInterface.php \Drupal\views\Plugin\views\ViewsHandlerInterface

Provides an interface for all views handlers.

Hierarchy

Expanded class hierarchy of ViewsHandlerInterface

All classes that implement ViewsHandlerInterface

2 files declare their use of ViewsHandlerInterface
FieldHandlerInterface.php in core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php
ModuleTest.php in core/modules/views/tests/src/Kernel/ModuleTest.php

File

core/modules/views/src/Plugin/views/ViewsHandlerInterface.php, line 11

Namespace

Drupal\views\Plugin\views
View source
interface ViewsHandlerInterface extends ViewsPluginInterface {
    
    /**
     * Run before the view is built.
     *
     * This gives all the handlers some time to set up before any handler has
     * been fully run.
     */
    public function preQuery();
    
    /**
     * Determines the entity type used by this handler.
     *
     * If this handler uses a relationship, the base class of the relationship is
     * taken into account.
     *
     * @return string
     *   The machine name of the entity type.
     */
    public function getEntityType();
    
    /**
     * Determines if the handler is considered 'broken'.
     *
     * Broken means it's a placeholder used when a handler can't be found.
     */
    public function broken();
    
    /**
     * Ensures that the main table for this handler is in the query.
     *
     * This is used a lot.
     */
    public function ensureMyTable();
    
    /**
     * Check whether given user has access to this handler.
     *
     * @param \Drupal\Core\Session\AccountInterface $account
     *   The user account to check.
     *
     * @return bool
     *   TRUE if the user has access to the handler, FALSE otherwise.
     */
    public function access(AccountInterface $account);
    
    /**
     * Get the join object that should be used for this handler.
     *
     * This method isn't used a great deal, but it's very handy for easily
     * getting the join if it is necessary to make some changes to it, such
     * as adding an 'extra'.
     */
    public function getJoin();
    
    /**
     * Sanitize the value for output.
     *
     * @param $value
     *   The value being rendered.
     * @param $type
     *   The type of sanitization needed. If not provided,
     *   \Drupal\Component\Utility\Html::escape() is used.
     *
     * @return \Drupal\views\Render\ViewsRenderPipelineMarkup
     *   Returns the safe value.
     */
    public function sanitizeValue($value, $type = NULL);
    
    /**
     * Fetches a handler to join one table to a primary table from the data cache.
     *
     * @param string $table
     *   The table to join from.
     * @param string $base_table
     *   The table to join to.
     *
     * @return \Drupal\views\Plugin\views\join\JoinPluginBase
     */
    public static function getTableJoin($table, $base_table);
    
    /**
     * Shortcut to get a handler's raw field value.
     *
     * This should be overridden for handlers with formulae or other
     * non-standard fields. Because this takes an argument, fields
     * overriding this can just call return parent::getField($formula)
     */
    public function getField($field = NULL);
    
    /**
     * Run after the view is executed, before the result is cached.
     *
     * This gives all the handlers some time to modify values. This is primarily
     * used so that handlers that pull up secondary data can put it in the
     * $values so that the raw data can be used externally.
     */
    public function postExecute(&$values);
    
    /**
     * Shortcut to display the exposed options form.
     */
    public function showExposeForm(&$form, FormStateInterface $form_state);
    
    /**
     * Sets up any needed relationship.
     *
     * This is called just prior to query().
     */
    public function setRelationship();
    
    /**
     * Return a string representing this handler's name in the UI.
     */
    public function adminLabel($short = FALSE);
    
    /**
     * Breaks x,y,z and x+y+z into an array.
     *
     * @param string $str
     *   The string to split.
     * @param bool $force_int
     *   Enforce a numeric check.
     *
     * @return object
     *   A stdClass object containing value and operator properties.
     */
    public static function breakString($str, $force_int = FALSE);
    
    /**
     * Provide text for the administrative summary.
     */
    public function adminSummary();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
ViewsHandlerInterface::access public function Check whether given user has access to this handler. 1
ViewsHandlerInterface::adminLabel public function Return a string representing this handler's name in the UI. 1
ViewsHandlerInterface::adminSummary public function Provide text for the administrative summary. 1
ViewsHandlerInterface::breakString public static function Breaks x,y,z and x+y+z into an array. 1
ViewsHandlerInterface::broken public function Determines if the handler is considered 'broken'. 1
ViewsHandlerInterface::ensureMyTable public function Ensures that the main table for this handler is in the query. 1
ViewsHandlerInterface::getEntityType public function Determines the entity type used by this handler. 1
ViewsHandlerInterface::getField public function Shortcut to get a handler's raw field value. 1
ViewsHandlerInterface::getJoin public function Get the join object that should be used for this handler. 1
ViewsHandlerInterface::getTableJoin public static function Fetches a handler to join one table to a primary table from the data cache. 1
ViewsHandlerInterface::postExecute public function Run after the view is executed, before the result is cached. 1
ViewsHandlerInterface::preQuery public function Run before the view is built. 1
ViewsHandlerInterface::sanitizeValue public function Sanitize the value for output. 1
ViewsHandlerInterface::setRelationship public function Sets up any needed relationship. 1
ViewsHandlerInterface::showExposeForm public function Shortcut to display the exposed options form. 1
ViewsPluginInterface::buildOptionsForm public function Provide a form to edit options for this plugin. 1
ViewsPluginInterface::create public static function
ViewsPluginInterface::destroy public function Clears a plugin. 1
ViewsPluginInterface::filterByDefinedOptions public function Filter out stored options depending on the defined options. 1
ViewsPluginInterface::getAvailableGlobalTokens public function Returns an array of available token replacements. 1
ViewsPluginInterface::getProvider public function Returns the plugin provider. 1
ViewsPluginInterface::globalTokenForm public function Adds elements for available core tokens to a form. 1
ViewsPluginInterface::globalTokenReplace public function Returns a string with any core tokens replaced. 1
ViewsPluginInterface::init public function Initialize the plugin. 1
ViewsPluginInterface::pluginTitle public function Return the human readable name of the display. 1
ViewsPluginInterface::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. 1
ViewsPluginInterface::preRenderFlattenData public static function Flattens the structure of form elements. 1
ViewsPluginInterface::query public function Add anything to the query that we might need to. 1
ViewsPluginInterface::submitOptionsForm public function Handle any special handling on the validate form. 1
ViewsPluginInterface::summaryTitle public function Returns the summary of the settings in the display. 1
ViewsPluginInterface::themeFunctions public function Provide a full list of possible theme templates used by this style. 1
ViewsPluginInterface::unpackOptions public function Unpacks options over our existing defaults. 1
ViewsPluginInterface::usesOptions public function Returns the usesOptions property. 1
ViewsPluginInterface::validate public function Validate that the plugin is correct and can be saved. 1
ViewsPluginInterface::validateOptionsForm public function Validate the options form. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.