Drupal 8  8.0.2
ViewsBlockBase Class Reference
Inheritance diagram for ViewsBlockBase:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageInterface $storage, AccountInterface $user)
 
 defaultConfiguration ()
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 blockSubmit ($form, FormStateInterface $form_state)
 
- Public Member Functions inherited from BlockBase
 label ()
 
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getConfiguration ()
 
 setConfiguration (array $configuration)
 
 defaultConfiguration ()
 
 setConfigurationValue ($key, $value)
 
 calculateDependencies ()
 
 access (AccountInterface $account, $return_as_object=FALSE)
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 blockForm ($form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 blockValidate ($form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
 blockSubmit ($form, FormStateInterface $form_state)
 
 getMachineNameSuggestion ()
 
 setTransliteration (TransliterationInterface $transliteration)
 
- Public Member Functions inherited from ContextAwarePluginBase
 getContext ($name)
 
 setContext ($name, ComponentContextInterface $context)
 
 setContextValue ($name, $value)
 
 getContextMapping ()
 
 setContextMapping (array $context_mapping)
 
 getContextDefinitions ()
 
 getContextDefinition ($name)
 
- Public Member Functions inherited from ContextAwarePluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getContextDefinitions ()
 
 getContextDefinition ($name)
 
 getContexts ()
 
 getContext ($name)
 
 setContext ($name, ContextInterface $context)
 
 getContextValues ()
 
 getContextValue ($name)
 
 setContextValue ($name, $value)
 
 validateContexts ()
 
- Public Member Functions inherited from PluginBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 getPluginId ()
 
 getBaseId ()
 
 getDerivativeId ()
 
 getPluginDefinition ()
 
- Public Member Functions inherited from BlockPluginInterface
 build ()
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 blockAccess (AccountInterface $account)
 
 addContextualLinks (&$output, $block_type= 'block')
 
- Protected Member Functions inherited from BlockBase
 baseConfigurationDefaults ()
 
 blockAccess (AccountInterface $account)
 
 transliteration ()
 
- Protected Member Functions inherited from ContextAwarePluginBase
 createContextFromConfiguration (array $context_configuration)
 
 contextHandler ()
 
- Protected Member Functions inherited from ContextAwarePluginBase
 createContextFromConfiguration (array $context_configuration)
 

Protected Attributes

 $view
 
 $displayID
 
 $displaySet
 
 $user
 
- Protected Attributes inherited from BlockBase
 $transliteration
 
- Protected Attributes inherited from ContextAwarePluginBase
 $context = []
 
- Protected Attributes inherited from PluginBase
 $pluginId
 
 $pluginDefinition
 
 $configuration
 

Additional Inherited Members

- Data Fields inherited from PluginBase
const DERIVATIVE_SEPARATOR = ':'
 

Detailed Description

Base class for Views block plugins.

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
ViewExecutableFactory  $executable_factory,
EntityStorageInterface  $storage,
AccountInterface  $user 
)

Constructs a object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\views\ViewExecutableFactory$executable_factoryThe view executable factory.
\Drupal\Core\Entity\EntityStorageInterface$storageThe views storage.
\Drupal\Core\Session\AccountInterface$userThe current user.

References ViewExecutableFactory\get(), DerivativeInspectionInterface\getDerivativeId(), and EntityStorageInterface\load().

Here is the call graph for this function:

Member Function Documentation

addContextualLinks ( $output,
  $block_type = 'block' 
)
protected

Converts Views block content to a renderable array with contextual links.

Parameters
string | array$outputAn string|array representing the block. This will be modified to be a renderable array, containing the optional '#contextual_links' property (if there are any contextual links associated with the block).
string$block_typeThe type of the block. If it's 'block' it's a regular views display, but 'exposed_filter' exist as well.

Referenced by ViewsBlock\build(), and ViewsExposedFilterBlock\build().

Here is the caller graph for this function:

blockAccess ( AccountInterface  $account)
protected

{}

References AccessResult\allowed(), and AccessResult\forbidden().

Here is the call graph for this function:

blockSubmit (   $form,
FormStateInterface  $form_state 
)

{Adds block type-specific submission handling for the block form.Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm().

Parameters
array$formThe form definition array for the full block configuration form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
See Also
::blockForm()
::blockValidate()
}

Implements BlockPluginInterface.

References FormStateInterface\getValue(), FormStateInterface\isValueEmpty(), and FormStateInterface\unsetValue().

Here is the call graph for this function:

buildConfigurationForm ( array  $form,
FormStateInterface  $form_state 
)

{Form constructor.Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see .

Parameters
array$formAn associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
Returns
array The form structure.
}

Implements PluginFormInterface.

References Drupal\moduleHandler(), t(), and Drupal\url().

Here is the call graph for this function:

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

Referenced by ViewsBlockTest\testMachineNameSuggestion().

Here is the caller graph for this function:

defaultConfiguration ( )

{Gets default configuration for this plugin.

Returns
array An associative array with the default configuration.
}

Implements ConfigurablePluginInterface.


The documentation for this class was generated from the following file: