Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
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/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * A check result class
-
 
19
 *
-
 
20
 * @package    core
-
 
21
 * @category   check
-
 
22
 * @copyright  2020 Brendan Heywood <brendan@catalyst-au.net>
-
 
23
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
24
 */
16
 
Línea 25... Línea -...
25
namespace core\check;
-
 
26
 
-
 
27
defined('MOODLE_INTERNAL') || die();
17
namespace core\check;
28
 
18
 
29
/**
19
/**
30
 * A check object returns a result object
20
 * A check object returns a result object
31
 *
21
 *
32
 * Most checks can use this an instance of this directly but if you have a
22
 * Most checks can use this an instance of this directly but if you have a
33
 * 'details' which is computationally expensive then extend this and overide
23
 * 'details' which is computationally expensive then extend this and overide
-
 
24
 * the get_details() method so that it is only called when it will be needed.
-
 
25
 *
34
 * the get_details() method so that it is only called when it will be needed.
26
 * @package    core
35
 *
27
 * @category   check
36
 * @copyright  2020 Brendan Heywood <brendan@catalyst-au.net>
28
 * @copyright  2020 Brendan Heywood <brendan@catalyst-au.net>
37
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Línea 108... Línea 100...
108
     * different states and actions to address them.
100
     * different states and actions to address them.
109
     */
101
     */
110
    protected $details = '';
102
    protected $details = '';
Línea 111... Línea 103...
111
 
103
 
112
    /**
-
 
113
     * Get the check reference label
-
 
114
     *
-
 
115
     * @return string must be globally unique
-
 
116
     */
-
 
117
    public function get_ref(): string {
-
 
118
        $ref = $this->get_component();
-
 
119
        if (!empty($ref)) {
-
 
120
            $ref .= '_';
-
 
121
        }
-
 
122
        $ref .= $this->get_id();
-
 
123
        return $ref;
-
 
124
    }
-
 
125
 
-
 
126
    /**
104
    /**
127
     * Constructor
105
     * Constructor
128
     *
106
     *
129
     * @param string $status code
107
     * @param string $status code
130
     * @param string $summary a 1 liner summary
108
     * @param string $summary a 1 liner summary