aboutsummaryrefslogtreecommitdiff
path: root/lib/migrations/SchemaVersion.php
blob: bbb2a6b26a7337dc320ae21c2e818dea4844b8fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
 * SchemaVersion.php - schema version interface for migrations
 *
 * This interface provides an abstract way to retrieve and set the current
 * version of a schema. Implementations of this interface need to define
 * where the version information is actually stored (e.g. in a file).
 *
 * @author    Marcus Lunzenauer <mlunzena@uos.de>
 * @copyright 2007 - Marcus Lunzenauer <mlunzena@uos.de>
 * @license   GPL2 or any later version
 * @package   migrations
 */
interface SchemaVersion
{
    /**
     * Returns current schema version (as maximum number).
     *
     * @return int schema version
     */
    public function get();

    /**
     * Returns whether the given version is already present for the given
     * domain.
     *
     * @param  int $version Version number
     * @return bool
     */
    public function contains($version);

    /**
     * Adds a schema version.
     *
     * @param int $version schema version
     */
    public function add($version);

    /**
     * Removes a schema version.
     *
     * @param int $version schema version
     */
    public function remove($version);
}