comparison core/lib/Drupal/Core/Access/AccessResultNeutral.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Access;
4
5 /**
6 * Value object indicating a neutral access result, with cacheability metadata.
7 */
8 class AccessResultNeutral extends AccessResult implements AccessResultReasonInterface {
9
10 /**
11 * The reason why access is neutral. For use in messages.
12 *
13 * @var string|null
14 */
15 protected $reason;
16
17 /**
18 * Constructs a new AccessResultNeutral 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 isNeutral() {
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 }