Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / lib / Doctrine / DBAL / Id / TableGeneratorSchemaVisitor.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\Id;
21
22 use Doctrine\DBAL\Schema\Table,
23     Doctrine\DBAL\Schema\Schema,
24     Doctrine\DBAL\Schema\Column,
25     Doctrine\DBAL\Schema\ForeignKeyConstraint,
26     Doctrine\DBAL\Schema\Constraint,
27     Doctrine\DBAL\Schema\Sequence,
28     Doctrine\DBAL\Schema\Index;
29
30 class TableGeneratorSchemaVisitor implements \Doctrine\DBAL\Schema\Visitor\Visitor
31 {
32     /**
33      * @var string
34      */
35     private $generatorTableName;
36
37     public function __construct($generatorTableName = 'sequences')
38     {
39         $this->generatorTableName = $generatorTableName;
40     }
41
42     /**
43      * @param Schema $schema
44      */
45     public function acceptSchema(Schema $schema)
46     {
47         $table = $schema->createTable($this->generatorTableName);
48         $table->addColumn('sequence_name', 'string');
49         $table->addColumn('sequence_value', 'integer', array('default' => 1));
50         $table->addColumn('sequence_increment_by', 'integer', array('default' => 1));
51     }
52
53     /**
54      * @param Table $table
55      */
56     public function acceptTable(Table $table)
57     {
58     }
59
60     /**
61      * @param Column $column
62      */
63     public function acceptColumn(Table $table, Column $column)
64     {
65     }
66
67     /**
68      * @param Table $localTable
69      * @param ForeignKeyConstraint $fkConstraint
70      */
71     public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
72     {
73     }
74
75     /**
76      * @param Table $table
77      * @param Index $index
78      */
79     public function acceptIndex(Table $table, Index $index)
80     {
81     }
82
83     /**
84      * @param Sequence $sequence
85      */
86     public function acceptSequence(Sequence $sequence)
87     {
88     }
89 }
90