Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Access / AccessResultForbidden.php
1 <?php
2
3 namespace Drupal\Core\Access;
4
5 /**
6  * Value object indicating a forbidden access result, with cacheability metadata.
7  */
8 class AccessResultForbidden extends AccessResult implements AccessResultReasonInterface {
9
10   /**
11    * The reason why access is forbidden. For use in error messages.
12    *
13    * @var string|null
14    */
15   protected $reason;
16
17   /**
18    * Constructs a new AccessResultForbidden instance.
19    *
20    * @param null|string $reason
21    *   (optional) A message to provide details about this access result.
22    */
23   public function __construct($reason = NULL) {
24     $this->reason = $reason;
25   }
26
27   /**
28    * {@inheritdoc}
29    */
30   public function isForbidden() {
31     return TRUE;
32   }
33
34   /**
35    * {@inheritdoc}
36    */
37   public function getReason() {
38     return $this->reason;
39   }
40
41   /**
42    * {@inheritdoc}
43    */
44   public function setReason($reason) {
45     $this->reason = $reason;
46     return $this;
47   }
48
49 }