public function get_files() {
        // The files array can contain stored file ids, so we need to get instances if asked.
        foreach ($this->files as $id => $listfile) {
            if (is_numeric($listfile)) {
                $fs = get_file_storage();

                if ($file = $fs->get_file_by_id($id)) {
                    $this->files[$id] = $file;
                } else {
                    unset($this->files[$id]); // Index is out of date and referencing a file that does not exist.
                }
            }
        }

        return $this->files;
    }
public function get_files() {
        // The files array can contain stored file ids, so we need to get instances if asked.
        foreach ($this->files as $id => $listfile) {
            if (is_numeric($listfile)) {
                $fs = get_file_storage();

                if ($file = $fs->get_file_by_id($id)) {
                    $this->files[$id] = $file;
                } else {
                    unset($this->files[$id]); // Index is out of date and referencing a file that does not exist.
                }
            }
        }

        return $this->files;
    }
public function get_files ( ) { // The files array can contain stored file ids, so we need to get instances if asked. foreach ( $ this -> files as $ id => $ listfile ) { if ( is_numeric ( $ listfile ) ) { $ fs = get_file_storage ( ) ; if ( $ file = $ fs -> get_file_by_id ( $ id ) ) { $ this -> files [ $ id ] = $ file ; } else { unset ( $ this -> files [ $ id ] ) ; // Index is out of date and referencing a file that does not exist. } } } return $ this -> files ; }
Returns the array of attached files.

@return \stored_file[]
Returns the array of attached files .