Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 14... Línea 14...
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...
16
 
16
 
Línea 17... Línea 17...
17
namespace core_course\cache;
17
namespace core_course\cache;
18
 
18
 
19
use cache_data_source;
19
use core_cache\data_source_interface;
20
use cache_definition;
20
use core_cache\definition;
Línea 21... Línea 21...
21
use moodle_url;
21
use moodle_url;
22
use core_course_list_element;
22
use core_course_list_element;
Línea 28... Línea 28...
28
 * @subpackage course
28
 * @subpackage course
29
 * @author     Dmitrii Metelkin <dmitriim@catalyst-au.net>
29
 * @author     Dmitrii Metelkin <dmitriim@catalyst-au.net>
30
 * @copyright  2021 Catalyst IT
30
 * @copyright  2021 Catalyst IT
31
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 */
32
 */
33
class course_image implements cache_data_source {
33
class course_image implements data_source_interface {
Línea 34... Línea 34...
34
 
34
 
35
    /** @var course_image */
35
    /** @var course_image */
Línea 36... Línea 36...
36
    protected static $instance = null;
36
    protected static $instance = null;
37
 
37
 
38
    /**
38
    /**
39
     * Returns an instance of the data source class that the cache can use for loading data using the other methods
39
     * Returns an instance of the data source class that the cache can use for loading data using the other methods
40
     * specified by this interface.
40
     * specified by this interface.
41
     *
41
     *
42
     * @param cache_definition $definition
42
     * @param definition $definition
43
     * @return \core_course\cache\course_image
43
     * @return \core_course\cache\course_image
44
     */
44
     */
45
    public static function get_instance_for_cache(cache_definition $definition): course_image {
45
    public static function get_instance_for_cache(definition $definition): course_image {
46
        if (is_null(self::$instance)) {
46
        if (is_null(self::$instance)) {
47
            self::$instance = new course_image();
47
            self::$instance = new course_image();
48
        }
48
        }