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.
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>.
20 namespace Doctrine\DBAL\Event;
22 use Doctrine\DBAL\Connection,
23 Doctrine\DBAL\Schema\Index;
26 * Event Arguments used when the portable index definition is generated inside Doctrine\DBAL\Schema\AbstractSchemaManager.
28 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
29 * @link www.doctrine-project.com
31 * @author Jan Sorgalla <jsorgalla@googlemail.com>
33 class SchemaIndexDefinitionEventArgs extends SchemaEventArgs
36 * @var \Doctrine\DBAL\Schema\Index
38 private $_index = null;
41 * Raw index data as fetched from the database
45 private $_tableIndex = null;
50 private $_table = null;
53 * @var \Doctrine\DBAL\Connection
55 private $_connection = null;
58 * @param array $tableIndex
59 * @param string $table
60 * @param \Doctrine\DBAL\Connection $conn
62 public function __construct(array $tableIndex, $table, Connection $connection)
64 $this->_tableIndex = $tableIndex;
65 $this->_table = $table;
66 $this->_connection = $connection;
70 * Allows to clear the index which means the index will be excluded from
73 * @param null|\Doctrine\DBAL\Schema\Index $index
74 * @return SchemaIndexDefinitionEventArgs
76 public function setIndex(Index $index = null)
78 $this->_index = $index;
84 * @return \Doctrine\DBAL\Schema\Index
86 public function getIndex()
94 public function getTableIndex()
96 return $this->_tableIndex;
102 public function getTable()
104 return $this->_table;
108 * @return \Doctrine\DBAL\Connection
110 public function getConnection()
112 return $this->_connection;
116 * @return \Doctrine\DBAL\Platforms\AbstractPlatform
118 public function getDatabasePlatform()
120 return $this->_connection->getDatabasePlatform();