Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / lib / Doctrine / DBAL / Schema / Synchronizer / SchemaSynchronizer.php
1 <?php
2 /*
3  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  *
15  * This software consists of voluntary contributions made by many individuals
16  * and is licensed under the MIT license. For more information, see
17  * <http://www.doctrine-project.org>.
18  */
19
20 namespace Doctrine\DBAL\Schema\Synchronizer;
21
22 use Doctrine\DBAL\Schema\Schema;
23
24 /**
25  * The synchronizer knows how to synchronize a schema with the configured
26  * database.
27  *
28  * @author Benjamin Eberlei <kontakt@beberlei.de>
29  */
30 interface SchemaSynchronizer
31 {
32     /**
33      * Get the SQL statements that can be executed to create the schema.
34      *
35      * @param Schema $createSchema
36      * @return array
37      */
38     function getCreateSchema(Schema $createSchema);
39
40     /**
41      * Get the SQL Statements to update given schema with the underlying db.
42      *
43      * @param Schema $toSchema
44      * @param bool $noDrops
45      * @return array
46      */
47     function getUpdateSchema(Schema $toSchema, $noDrops = false);
48
49     /**
50      * Get the SQL Statements to drop the given schema from underlying db.
51      *
52      * @param Schema $dropSchema
53      * @return array
54      */
55     function getDropSchema(Schema $dropSchema);
56
57     /**
58      * Get the SQL statements to drop all schema assets from underlying db.
59      *
60      * @return array
61      */
62     function getDropAllSchema();
63
64     /**
65      * Create the Schema
66      *
67      * @param Schema $createSchema
68      * @return void
69      */
70     function createSchema(Schema $createSchema);
71
72     /**
73      * Update the Schema to new schema version.
74      *
75      * @param Schema $toSchema
76      * @param bool $noDrops
77      * @return void
78      */
79     function updateSchema(Schema $toSchema, $noDrops = false);
80
81     /**
82      * Drop the given database schema from the underlying db.
83      *
84      * @param Schema $dropSchema
85      * @return void
86      */
87     function dropSchema(Schema $dropSchema);
88
89     /**
90      * Drop all assets from the underyling db.
91      *
92      * @return void
93      */
94     function dropAllSchema();
95 }
96