2 // This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 * Represents multiple availability messages.
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.
24 * The tree structure of this object matches that of the availability
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
33 * Represents multiple availability messages.
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.
39 * The tree structure of this object matches that of the availability
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
46 class core_availability_multiple_messages
implements renderable
{
47 /** @var bool True if this object represents the root of the tree */
49 /** @var bool True if items use the AND operator (false = OR) */
51 /** @var bool True if this part of the tree is marked 'hide entirely' for non-matching users */
53 /** @var array Array of child items (may be string or this type) */
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)
64 public function __construct($root, $andoperator, $treehidden, array $items) {
66 $this->andoperator
= $andoperator;
67 $this->treehidden
= $treehidden;
68 $this->items
= $items;