Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 13... Línea 13...
13
//
13
//
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
 
-
 
17
declare(strict_types=1);
17
declare(strict_types=1);
18
 
-
 
19
namespace mod_scorm\cache;
-
 
20
 
18
namespace mod_scorm\cache;
21
use core_cache\data_source_interface;
Línea 19... Línea 22...
19
use cache_definition;
22
use core_cache\definition;
20
 
23
 
21
/**
24
/**
22
 * Cache data source for the scorm elements.
25
 * Cache data source for the scorm elements.
23
 *
26
 *
24
 * @package   mod_scorm
27
 * @package   mod_scorm
25
 * @copyright 2023 Catalyst IT Ltd
28
 * @copyright 2023 Catalyst IT Ltd
26
 * @author    Dan Marsden <dan@danmarsden.com>
29
 * @author    Dan Marsden <dan@danmarsden.com>
27
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Línea 28... Línea 31...
28
 */
31
 */
29
class elements implements \cache_data_source {
32
class elements implements data_source_interface {
Línea 30... Línea 33...
30
 
33
 
31
    /** @var elements the singleton instance of this class. */
34
    /** @var elements the singleton instance of this class. */
32
    protected static $instance = null;
35
    protected static $instance = null;
33
 
36
 
34
    /**
37
    /**
35
     * Returns an instance of the data source class that the cache can use for loading data using the other methods
38
     * Returns an instance of the data source class that the cache can use for loading data using the other methods
36
     * specified by this interface.
39
     * specified by this interface.
37
     *
40
     *
38
     * @param cache_definition $definition
41
     * @param definition $definition
39
     * @return object
42
     * @return object
40
     */
43
     */
41
    public static function get_instance_for_cache(cache_definition $definition): elements {
44
    public static function get_instance_for_cache(definition $definition): elements {
42
        if (is_null(self::$instance)) {
45
        if (is_null(self::$instance)) {