Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / lib / Doctrine / DBAL / Event / SchemaDropTableEventArgs.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\Event;
21
22 use Doctrine\DBAL\Platforms\AbstractPlatform,
23     Doctrine\DBAL\Schema\Table;
24
25 /**
26  * Event Arguments used when the SQL query for dropping tables are generated inside Doctrine\DBAL\Platform\AbstractPlatform.
27  *
28  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
29  * @link        www.doctrine-project.com
30  * @since       2.2
31  * @author      Jan Sorgalla <jsorgalla@googlemail.com>
32  */
33 class SchemaDropTableEventArgs extends SchemaEventArgs
34 {
35     /**
36      * @var string|\Doctrine\DBAL\Schema\Table
37      */
38     private $_table = null;
39
40     /**
41      * @var \Doctrine\DBAL\Platforms\AbstractPlatform
42      */
43     private $_platform = null;
44
45     /**
46      * @var string
47      */
48     private $_sql = null;
49
50     /**
51      * @param string|\Doctrine\DBAL\Schema\Table $table
52      * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
53      */
54     public function __construct($table, AbstractPlatform $platform)
55     {
56         if ( ! $table instanceof Table && !is_string($table)) {
57             throw new \InvalidArgumentException('SchemaCreateTableEventArgs expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
58         }
59
60         $this->_table    = $table;
61         $this->_platform = $platform;
62     }
63
64     /**
65      * @return string|\Doctrine\DBAL\Schema\Table
66      */
67     public function getTable()
68     {
69         return $this->_table;
70     }
71
72     /**
73      * @return \Doctrine\DBAL\Platforms\AbstractPlatform
74      */
75     public function getPlatform()
76     {
77         return $this->_platform;
78     }
79
80     /**
81      * @param string $sql
82      * @return \Doctrine\DBAL\Event\SchemaDropTableEventArgs
83      */
84     public function setSql($sql)
85     {
86         $this->_sql = $sql;
87
88         return $this;
89     }
90
91     /**
92      * @return string
93      */
94     public function getSql()
95     {
96         return $this->_sql;
97     }
98 }