Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403]
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 * Field persistent class 19 * 20 * @package core_customfield 21 * @copyright 2018 Toni Barbera <toni@moodle.com> 22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 */ 24 25 namespace core_customfield; 26 27 use core\persistent; 28 29 defined('MOODLE_INTERNAL') || die; 30 31 /** 32 * Class field 33 * 34 * @package core_customfield 35 * @copyright 2018 Toni Barbera <toni@moodle.com> 36 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 37 */ 38 class field extends persistent { 39 40 /** 41 * Database table. 42 */ 43 const TABLE = 'customfield_field'; 44 45 /** 46 * Return the definition of the properties of this model. 47 * 48 * @return array 49 */ 50 protected static function define_properties() : array { 51 return array( 52 'name' => [ 53 'type' => PARAM_TEXT, 54 ], 55 'shortname' => [ 56 'type' => PARAM_TEXT, 57 ], 58 'type' => [ 59 'type' => PARAM_PLUGIN, 60 ], 61 'description' => [ 62 'type' => PARAM_RAW, 63 'optional' => true, 64 'default' => null, 65 'null' => NULL_ALLOWED 66 ], 67 'descriptionformat' => [ 68 'type' => PARAM_INT, 69 'default' => FORMAT_MOODLE, 70 'optional' => true 71 ], 72 'sortorder' => [ 73 'type' => PARAM_INT, 74 'optional' => true, 75 'default' => -1, 76 ], 77 'categoryid' => [ 78 'type' => PARAM_INT 79 ], 80 'configdata' => [ 81 'type' => PARAM_RAW, 82 'optional' => true, 83 'default' => null, 84 'null' => NULL_ALLOWED 85 ], 86 ); 87 } 88 89 /** 90 * Get decoded configdata. 91 * 92 * @return array 93 */ 94 protected function get_configdata() : array { 95 return json_decode($this->raw_get('configdata') ?? '', true) ?? array(); 96 } 97 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body