Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views / src / Plugin / views / ViewsHandlerInterface.php
1 <?php
2
3 namespace Drupal\views\Plugin\views;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\Core\Session\AccountInterface;
7
8 /**
9  * Provides an interface for all views handlers.
10  */
11 interface ViewsHandlerInterface extends ViewsPluginInterface {
12
13   /**
14    * Run before the view is built.
15    *
16    * This gives all the handlers some time to set up before any handler has
17    * been fully run.
18    */
19   public function preQuery();
20
21   /**
22    * Determines the entity type used by this handler.
23    *
24    * If this handler uses a relationship, the base class of the relationship is
25    * taken into account.
26    *
27    * @return string
28    *   The machine name of the entity type.
29    */
30   public function getEntityType();
31
32   /**
33    * Determines if the handler is considered 'broken', meaning it's a
34    * a placeholder used when a handler can't be found.
35    */
36   public function broken();
37
38   /**
39    * Ensure the main table for this handler is in the query. This is used
40    * a lot.
41    */
42   public function ensureMyTable();
43
44   /**
45    * Check whether given user has access to this handler.
46    *
47    * @param AccountInterface $account
48    *   The user account to check.
49    *
50    * @return bool
51    *   TRUE if the user has access to the handler, FALSE otherwise.
52    */
53   public function access(AccountInterface $account);
54
55   /**
56    * Get the join object that should be used for this handler.
57    *
58    * This method isn't used a great deal, but it's very handy for easily
59    * getting the join if it is necessary to make some changes to it, such
60    * as adding an 'extra'.
61    */
62   public function getJoin();
63
64   /**
65    * Sanitize the value for output.
66    *
67    * @param $value
68    *   The value being rendered.
69    * @param $type
70    *   The type of sanitization needed. If not provided,
71    *   \Drupal\Component\Utility\Html::escape() is used.
72    *
73    * @return \Drupal\views\Render\ViewsRenderPipelineMarkup
74    *   Returns the safe value.
75    */
76   public function sanitizeValue($value, $type = NULL);
77
78   /**
79    * Fetches a handler to join one table to a primary table from the data cache.
80    *
81    * @param string $table
82    *   The table to join from.
83    * @param string $base_table
84    *   The table to join to.
85    *
86    * @return \Drupal\views\Plugin\views\join\JoinPluginBase
87    */
88   public static function getTableJoin($table, $base_table);
89
90   /**
91    * Shortcut to get a handler's raw field value.
92    *
93    * This should be overridden for handlers with formulae or other
94    * non-standard fields. Because this takes an argument, fields
95    * overriding this can just call return parent::getField($formula)
96    */
97   public function getField($field = NULL);
98
99   /**
100    * Run after the view is executed, before the result is cached.
101    *
102    * This gives all the handlers some time to modify values. This is primarily
103    * used so that handlers that pull up secondary data can put it in the
104    * $values so that the raw data can be used externally.
105    */
106   public function postExecute(&$values);
107
108   /**
109    * Shortcut to display the exposed options form.
110    */
111   public function showExposeForm(&$form, FormStateInterface $form_state);
112
113   /**
114    * Called just prior to query(), this lets a handler set up any relationship
115    * it needs.
116    */
117   public function setRelationship();
118
119   /**
120    * Return a string representing this handler's name in the UI.
121    */
122   public function adminLabel($short = FALSE);
123
124   /**
125    * Breaks x,y,z and x+y+z into an array.
126    *
127    * @param string $str
128    *   The string to split.
129    * @param bool $force_int
130    *   Enforce a numeric check.
131    *
132    * @return \stdClass
133    *   A stdClass object containing value and operator properties.
134    */
135   public static function breakString($str, $force_int = FALSE);
136
137   /**
138    * Provide text for the administrative summary.
139    */
140   public function adminSummary();
141
142 }