MDL-49434 availability: fix trailing whitespace
[moodle.git] / availability / classes / multiple_messages.php
CommitLineData
c7b73854 1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * Represents multiple availability messages.
19 *
20 * These are messages like 'Not available until <date>'. This class includes
21 * multiple messages so that they can be rendered into a combined display, e.g.
22 * using bulleted lists.
23 *
24 * The tree structure of this object matches that of the availability
e870b103 25 * restrictions.
c7b73854 26 *
27 * @package core_availability
28 * @copyright 2015 Andrew Nicols <andrew@nicols.co.uk>
29 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30 */
31
32/**
33 * Represents multiple availability messages.
34 *
35 * These are messages like 'Not available until <date>'. This class includes
36 * multiple messages so that they can be rendered into a combined display, e.g.
37 * using bulleted lists.
38 *
39 * The tree structure of this object matches that of the availability
40 * restrictions.
41 *
42 * @package core_availability
43 * @copyright 2015 Andrew Nicols <andrew@nicols.co.uk>
44 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
45 */
46class core_availability_multiple_messages implements renderable {
47 /** @var bool True if this object represents the root of the tree */
48 public $root;
49 /** @var bool True if items use the AND operator (false = OR) */
50 public $andoperator;
51 /** @var bool True if this part of the tree is marked 'hide entirely' for non-matching users */
52 public $treehidden;
53 /** @var array Array of child items (may be string or this type) */
54 public $items;
55
56 /**
57 * Constructor.
58 *
59 * @param bool $root True if this object represents the root of the tree
60 * @param bool $andoperator True if items use the AND operator (false = OR)
61 * @param bool $treehidden True if this part of the tree is marked 'hide entirely' for non-matching users
62 * @param array $items Array of items (may be string or this type)
63 */
64 public function __construct($root, $andoperator, $treehidden, array $items) {
65 $this->root = $root;
66 $this->andoperator = $andoperator;
67 $this->treehidden = $treehidden;
68 $this->items = $items;
69 }
70}