Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / views / src / Plugin / views / display / DefaultDisplay.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\display;
4
5 /**
6  * A plugin to handle defaults on a view.
7  *
8  * @ingroup views_display_plugins
9  *
10  * @ViewsDisplay(
11  *   id = "default",
12  *   title = @Translation("Master"),
13  *   help = @Translation("Default settings for this view."),
14  *   theme = "views_view",
15  *   no_ui = TRUE
16  * )
17  */
18 class DefaultDisplay extends DisplayPluginBase {
19
20   /**
21    * Whether the display allows attachments.
22    *
23    * @var bool
24    */
25   protected $usesAttachments = TRUE;
26
27   /**
28    * Determine if this display is the 'default' display which contains
29    * fallback settings
30    */
31   public function isDefaultDisplay() {
32     return TRUE;
33   }
34
35   /**
36    * The default execute handler fully renders the view.
37    *
38    * For the simplest use:
39    * @code
40    *   $output = $view->executeDisplay('default', $args);
41    * @endcode
42    *
43    * For more complex usages, a view can be partially built:
44    * @code
45    *   $view->setArguments($args);
46    *   $view->build('default'); // Build the query
47    *   $view->preExecute(); // Pre-execute the query.
48    *   $view->execute(); // Run the query
49    *   $output = $view->render(); // Render the view
50    * @endcode
51    *
52    * If short circuited at any point, look in $view->build_info for
53    * information about the query. After execute, look in $view->result
54    * for the array of objects returned from db_query.
55    *
56    * You can also do:
57    * @code
58    *   $view->setArguments($args);
59    *   $output = $view->render('default'); // Render the view
60    * @endcode
61    *
62    * This illustrates that render is smart enough to call build and execute
63    * if these items have not already been accomplished.
64    *
65    * Note that execute also must accomplish other tasks, such as setting page
66    * titles, and generating exposed filter data if necessary.
67    */
68   public function execute() {
69     return $this->view->render($this->display['id']);
70   }
71
72 }