Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 44... Línea 44...
44
     * @param null|array $options general options for course module. Since 2.6 it is
44
     * @param null|array $options general options for course module. Since 2.6 it is
45
     *     possible to omit this argument by merging options into $record
45
     *     possible to omit this argument by merging options into $record
46
     * @return stdClass record from module-defined table with additional field
46
     * @return stdClass record from module-defined table with additional field
47
     *     cmid (corresponding id in course_modules table)
47
     *     cmid (corresponding id in course_modules table)
48
     */
48
     */
49
    public function create_instance($record = null, array $options = null) {
49
    public function create_instance($record = null, ?array $options = null) {
50
        global $CFG, $USER;
50
        global $CFG, $USER;
51
        require_once($CFG->dirroot . '/lib/resourcelib.php');
51
        require_once($CFG->dirroot . '/lib/resourcelib.php');
52
        // Ensure the record can be modified without affecting calling code.
52
        // Ensure the record can be modified without affecting calling code.
53
        $record = (object)(array)$record;
53
        $record = (object)(array)$record;