1 <?php
 2 
 3 /**
 4  * Backend main page class.
 5  *
 6  * @package redaxo\core\backend
 7  */
 8 class rex_be_page_main extends rex_be_page
 9 {
10     private $block;
11     private $prio = 0;
12 
13     /**
14      * Constructor.
15      *
16      * @param string $block Navigation block
17      * @param string $key
18      * @param string $title
19      *
20      * @throws InvalidArgumentException
21      */
22     public function __construct($block, $key, $title)
23     {
24         if (!is_string($block)) {
25             throw new InvalidArgumentException('Expecting $block to be a string, ' . gettype($block) . 'given!');
26         }
27         $this->block = $block;
28 
29         parent::__construct($key, $title);
30     }
31 
32     /**
33      * Sets the navigation block.
34      *
35      * @param string $block
36      *
37      * @return $this
38      */
39     public function setBlock($block)
40     {
41         $this->block = $block;
42 
43         return $this;
44     }
45 
46     /**
47      * Returns the navigation block.
48      *
49      * @return string
50      */
51     public function getBlock()
52     {
53         return $this->block;
54     }
55 
56     /**
57      * Sets the priority.
58      *
59      * @param int $prio
60      *
61      * @return $this
62      */
63     public function setPrio($prio)
64     {
65         $this->prio = $prio;
66 
67         return $this;
68     }
69 
70     /**
71      * Returns the priority.
72      *
73      * @return int
74      */
75     public function getPrio()
76     {
77         return $this->prio;
78     }
79 }
80