Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
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 -... Línea 16...
-
 
16
 
-
 
17
use core_cache\versionable_data_source_interface;
16
 
18
 
17
/**
19
/**
18
 * A dummy datasource which supports versioning.
20
 * A dummy datasource which supports versioning.
19
 *
21
 *
20
 * @package core_cache
22
 * @package core_cache
21
 * @copyright 2021 The Open University
23
 * @copyright 2021 The Open University
22
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
25
 */
24
class cache_phpunit_dummy_datasource_versionable extends cache_phpunit_dummy_datasource
26
class cache_phpunit_dummy_datasource_versionable extends cache_phpunit_dummy_datasource implements
-
 
27
    versionable_data_source_interface
25
        implements cache_data_source_versionable {
28
{
26
    /** @var array Data in cache */
29
    /** @var array Data in cache */
Línea 27... Línea 30...
27
    protected $data = [];
30
    protected $data = [];
28
 
31
 
Línea 33... Línea 36...
33
     * Returns an instance of this object for use with the cache.
36
     * Returns an instance of this object for use with the cache.
34
     *
37
     *
35
     * @param cache_definition $definition
38
     * @param cache_definition $definition
36
     * @return cache_phpunit_dummy_datasource New object
39
     * @return cache_phpunit_dummy_datasource New object
37
     */
40
     */
38
    public static function get_instance_for_cache(cache_definition $definition):
41
    public static function get_instance_for_cache(cache_definition $definition): cache_phpunit_dummy_datasource_versionable {
39
            cache_phpunit_dummy_datasource_versionable {
-
 
40
        self::$lastinstance = new cache_phpunit_dummy_datasource_versionable();
42
        self::$lastinstance = new cache_phpunit_dummy_datasource_versionable();
41
        return self::$lastinstance;
43
        return self::$lastinstance;
42
    }
44
    }
Línea 43... Línea 45...
43
 
45
 
Línea 79... Línea 81...
79
        }
81
        }
80
        $actualversion = $value->version;
82
        $actualversion = $value->version;
81
        return $value->data;
83
        return $value->data;
82
    }
84
    }
83
}
85
}
84
 
-