Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 66... Línea 66...
66
     *
66
     *
67
     * @param array $record
67
     * @param array $record
68
     * @param array $options
68
     * @param array $options
69
     * @return StdClass
69
     * @return StdClass
70
     */
70
     */
71
    public function create_instance($record = null, array $options = null) {
71
    public function create_instance($record = null, ?array $options = null) {
72
        // Note, the parent class does not type $record to cast to array and then to object.
72
        // Note, the parent class does not type $record to cast to array and then to object.
73
        $record = (object) (array) $record;
73
        $record = (object) (array) $record;
Línea 74... Línea 74...
74
 
74
 
75
        if (!isset($record->assessed)) {
75
        if (!isset($record->assessed)) {
Línea 87... Línea 87...
87
     *
87
     *
88
     * @param stdClass $record
88
     * @param stdClass $record
89
     * @param stdClass|null $data
89
     * @param stdClass|null $data
90
     * @return data_field_base
90
     * @return data_field_base
91
     */
91
     */
92
    public function create_field(stdClass $record = null, $data = null) {
92
    public function create_field(?stdClass $record = null, $data = null) {
93
        $record = (array) $record;
93
        $record = (array) $record;
Línea 94... Línea 94...
94
 
94
 
Línea 95... Línea 95...
95
        $this->databasefieldcount++;
95
        $this->databasefieldcount++;
Línea 212... Línea 212...
212
     * @param array $tags
212
     * @param array $tags
213
     * @param array $options
213
     * @param array $options
214
     * @param int $userid if defined, it will be the author of the entry
214
     * @param int $userid if defined, it will be the author of the entry
215
     * @return int id of the generated record in table {data_records}
215
     * @return int id of the generated record in table {data_records}
216
     */
216
     */
217
    public function create_entry($data, array $contents, $groupid = 0, $tags = [], array $options = null, int $userid = 0) {
217
    public function create_entry($data, array $contents, $groupid = 0, $tags = [], ?array $options = null, int $userid = 0) {
218
        global $DB, $USER, $CFG;
218
        global $DB, $USER, $CFG;
Línea 219... Línea 219...
219
 
219
 
220
        // Set current user if defined.
220
        // Set current user if defined.
221
        if (!empty($userid)) {
221
        if (!empty($userid)) {
Línea 385... Línea 385...
385
     *
385
     *
386
     * @param stdClass $instance The mod_data instance.
386
     * @param stdClass $instance The mod_data instance.
387
     * @param stdClass|null $record The preset information, like 'name'.
387
     * @param stdClass|null $record The preset information, like 'name'.
388
     * @return preset The preset that has been created.
388
     * @return preset The preset that has been created.
389
     */
389
     */
390
    public function create_preset(stdClass $instance, stdClass $record = null): preset {
390
    public function create_preset(stdClass $instance, ?stdClass $record = null): preset {
391
        global $USER;
391
        global $USER;
Línea 392... Línea 392...
392
 
392
 
393
        if (is_null($record)) {
393
        if (is_null($record)) {
394
            $record = new stdClass();
394
            $record = new stdClass();