提交代码
This commit is contained in:
82
vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
vendored
Normal file
82
vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\DBAL\Event;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Schema\Column;
|
||||
use Doctrine\DBAL\Schema\TableDiff;
|
||||
use function array_merge;
|
||||
use function is_array;
|
||||
|
||||
/**
|
||||
* Event Arguments used when SQL queries for adding table columns are generated inside Doctrine\DBAL\Platform\*Platform.
|
||||
*/
|
||||
class SchemaAlterTableAddColumnEventArgs extends SchemaEventArgs
|
||||
{
|
||||
/** @var Column */
|
||||
private $column;
|
||||
|
||||
/** @var TableDiff */
|
||||
private $tableDiff;
|
||||
|
||||
/** @var AbstractPlatform */
|
||||
private $platform;
|
||||
|
||||
/** @var string[] */
|
||||
private $sql = [];
|
||||
|
||||
public function __construct(Column $column, TableDiff $tableDiff, AbstractPlatform $platform)
|
||||
{
|
||||
$this->column = $column;
|
||||
$this->tableDiff = $tableDiff;
|
||||
$this->platform = $platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Column
|
||||
*/
|
||||
public function getColumn()
|
||||
{
|
||||
return $this->column;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TableDiff
|
||||
*/
|
||||
public function getTableDiff()
|
||||
{
|
||||
return $this->tableDiff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractPlatform
|
||||
*/
|
||||
public function getPlatform()
|
||||
{
|
||||
return $this->platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|string[] $sql
|
||||
*
|
||||
* @return \Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs
|
||||
*/
|
||||
public function addSql($sql)
|
||||
{
|
||||
if (is_array($sql)) {
|
||||
$this->sql = array_merge($this->sql, $sql);
|
||||
} else {
|
||||
$this->sql[] = $sql;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSql()
|
||||
{
|
||||
return $this->sql;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user