@@ 33-129 (lines=97) @@ | ||
30 | * @since 2.2 |
|
31 | * @author Jan Sorgalla <[email protected]> |
|
32 | */ |
|
33 | class SchemaAlterTableRenameColumnEventArgs extends SchemaEventArgs |
|
34 | { |
|
35 | /** |
|
36 | * @var string |
|
37 | */ |
|
38 | private $_oldColumnName; |
|
39 | ||
40 | /** |
|
41 | * @var \Doctrine\DBAL\Schema\Column |
|
42 | */ |
|
43 | private $_column; |
|
44 | ||
45 | /** |
|
46 | * @var \Doctrine\DBAL\Schema\TableDiff |
|
47 | */ |
|
48 | private $_tableDiff; |
|
49 | ||
50 | /** |
|
51 | * @var \Doctrine\DBAL\Platforms\AbstractPlatform |
|
52 | */ |
|
53 | private $_platform; |
|
54 | ||
55 | /** |
|
56 | * @var array |
|
57 | */ |
|
58 | private $_sql = []; |
|
59 | ||
60 | /** |
|
61 | * @param string $oldColumnName |
|
62 | * @param \Doctrine\DBAL\Schema\Column $column |
|
63 | * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff |
|
64 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform |
|
65 | */ |
|
66 | public function __construct($oldColumnName, Column $column, TableDiff $tableDiff, AbstractPlatform $platform) |
|
67 | { |
|
68 | $this->_oldColumnName = $oldColumnName; |
|
69 | $this->_column = $column; |
|
70 | $this->_tableDiff = $tableDiff; |
|
71 | $this->_platform = $platform; |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * @return string |
|
76 | */ |
|
77 | public function getOldColumnName() |
|
78 | { |
|
79 | return $this->_oldColumnName; |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * @return \Doctrine\DBAL\Schema\Column |
|
84 | */ |
|
85 | public function getColumn() |
|
86 | { |
|
87 | return $this->_column; |
|
88 | } |
|
89 | ||
90 | /** |
|
91 | * @return \Doctrine\DBAL\Schema\TableDiff |
|
92 | */ |
|
93 | public function getTableDiff() |
|
94 | { |
|
95 | return $this->_tableDiff; |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * @return \Doctrine\DBAL\Platforms\AbstractPlatform |
|
100 | */ |
|
101 | public function getPlatform() |
|
102 | { |
|
103 | return $this->_platform; |
|
104 | } |
|
105 | ||
106 | /** |
|
107 | * @param string|array $sql |
|
108 | * |
|
109 | * @return \Doctrine\DBAL\Event\SchemaAlterTableRenameColumnEventArgs |
|
110 | */ |
|
111 | public function addSql($sql) |
|
112 | { |
|
113 | if (is_array($sql)) { |
|
114 | $this->_sql = array_merge($this->_sql, $sql); |
|
115 | } else { |
|
116 | $this->_sql[] = $sql; |
|
117 | } |
|
118 | ||
119 | return $this; |
|
120 | } |
|
121 | ||
122 | /** |
|
123 | * @return array |
|
124 | */ |
|
125 | public function getSql() |
|
126 | { |
|
127 | return $this->_sql; |
|
128 | } |
|
129 | } |
|
130 |
@@ 32-128 (lines=97) @@ | ||
29 | * @since 2.2 |
|
30 | * @author Jan Sorgalla <[email protected]> |
|
31 | */ |
|
32 | class SchemaCreateTableEventArgs extends SchemaEventArgs |
|
33 | { |
|
34 | /** |
|
35 | * @var \Doctrine\DBAL\Schema\Table |
|
36 | */ |
|
37 | private $_table; |
|
38 | ||
39 | /** |
|
40 | * @var array |
|
41 | */ |
|
42 | private $_columns; |
|
43 | ||
44 | /** |
|
45 | * @var array |
|
46 | */ |
|
47 | private $_options; |
|
48 | ||
49 | /** |
|
50 | * @var \Doctrine\DBAL\Platforms\AbstractPlatform |
|
51 | */ |
|
52 | private $_platform; |
|
53 | ||
54 | /** |
|
55 | * @var array |
|
56 | */ |
|
57 | private $_sql = []; |
|
58 | ||
59 | /** |
|
60 | * @param \Doctrine\DBAL\Schema\Table $table |
|
61 | * @param array $columns |
|
62 | * @param array $options |
|
63 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform |
|
64 | */ |
|
65 | public function __construct(Table $table, array $columns, array $options, AbstractPlatform $platform) |
|
66 | { |
|
67 | $this->_table = $table; |
|
68 | $this->_columns = $columns; |
|
69 | $this->_options = $options; |
|
70 | $this->_platform = $platform; |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * @return \Doctrine\DBAL\Schema\Table |
|
75 | */ |
|
76 | public function getTable() |
|
77 | { |
|
78 | return $this->_table; |
|
79 | } |
|
80 | ||
81 | /** |
|
82 | * @return array |
|
83 | */ |
|
84 | public function getColumns() |
|
85 | { |
|
86 | return $this->_columns; |
|
87 | } |
|
88 | ||
89 | /** |
|
90 | * @return array |
|
91 | */ |
|
92 | public function getOptions() |
|
93 | { |
|
94 | return $this->_options; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * @return \Doctrine\DBAL\Platforms\AbstractPlatform |
|
99 | */ |
|
100 | public function getPlatform() |
|
101 | { |
|
102 | return $this->_platform; |
|
103 | } |
|
104 | ||
105 | /** |
|
106 | * @param string|array $sql |
|
107 | * |
|
108 | * @return \Doctrine\DBAL\Event\SchemaCreateTableEventArgs |
|
109 | */ |
|
110 | public function addSql($sql) |
|
111 | { |
|
112 | if (is_array($sql)) { |
|
113 | $this->_sql = array_merge($this->_sql, $sql); |
|
114 | } else { |
|
115 | $this->_sql[] = $sql; |
|
116 | } |
|
117 | ||
118 | return $this; |
|
119 | } |
|
120 | ||
121 | /** |
|
122 | * @return array |
|
123 | */ |
|
124 | public function getSql() |
|
125 | { |
|
126 | return $this->_sql; |
|
127 | } |
|
128 | } |
|
129 |