. */ namespace Doctrine\DBAL\Event; use Doctrine\DBAL\Platforms\AbstractPlatform, Doctrine\DBAL\Schema\Column, Doctrine\DBAL\Schema\Table; /** * Event Arguments used when SQL queries for creating table columns are generated inside Doctrine\DBAL\Platform\AbstractPlatform. * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.com * @since 2.2 * @author Jan Sorgalla */ class SchemaCreateTableColumnEventArgs extends SchemaEventArgs { /** * @var \Doctrine\DBAL\Schema\Column */ private $_column = null; /** * @var \Doctrine\DBAL\Schema\Table */ private $_table = null; /** * @var \Doctrine\DBAL\Platforms\AbstractPlatform */ private $_platform = null; /** * @var array */ private $_sql = array(); /** * @param \Doctrine\DBAL\Schema\Column $column * @param \Doctrine\DBAL\Schema\Table $table * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform */ public function __construct(Column $column, Table $table, AbstractPlatform $platform) { $this->_column = $column; $this->_table = $table; $this->_platform = $platform; } /** * @return \Doctrine\DBAL\Schema\Column */ public function getColumn() { return $this->_column; } /** * @return \Doctrine\DBAL\Schema\Table */ public function getTable() { return $this->_table; } /** * @return \Doctrine\DBAL\Platforms\AbstractPlatform */ public function getPlatform() { return $this->_platform; } /** * @param string|array $sql * @return \Doctrine\DBAL\Event\SchemaCreateTableColumnEventArgs */ public function addSql($sql) { if (is_array($sql)) { $this->_sql = array_merge($this->_sql, $sql); } else { $this->_sql[] = $sql; } return $this; } /** * @return array */ public function getSql() { return $this->_sql; } }