stacks-8.x-1.x-dev/src/Plugin/WidgetTypeInterface.php
src/Plugin/WidgetTypeInterface.php
<?php
namespace Drupal\stacks\Plugin;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Entity\EntityInterface;
/**
* Interface WidgetTypeInterface
* @package Drupal\stacks
*
* Use this when creating a new widget type. If this is a new grid, extend
* a class that implements this.
*/
interface WidgetTypeInterface extends PluginInspectionInterface {
/**
* Define the fields that should not be sent to the template as variables.
* These are usually fields on the content type that you want to handle via
* programming only. This is meant to be overridden by child classes.
*
* @return array
*/
public function fieldExceptions();
/**
* If this widget type is using an entity, set the entity object here.
* @param \Drupal\Core\Entity\EntityInterface $entity
* @return
*/
public function setEntity(EntityInterface $entity);
/**
* If this grid is not using an entity, we need to set some of the variables.
*
* @param int - Unique id of this widget type. Useful when this is used multiple
* times on the page.
*/
public function setNoneEntity($unique_id);
/**
* Modify the render array before output.
*
* @param $render_array - This is the default render array generated by the
* Stacks system.
* @param $options - Send options for this specific widget type.
*/
public function modifyRenderArray(&$render_array, $options = []);
}