Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
6abba72f
Commit
6abba72f
authored
Dec 09, 2011
by
jsor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename alter table events
parent
b51762cd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
36 deletions
+36
-36
SchemaAlterTableAddColumnEventArgs.php
...octrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
+1
-1
SchemaAlterTableChangeColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
+1
-1
SchemaAlterTableRemoveColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php
+1
-1
SchemaAlterTableRenameColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php
+1
-1
Events.php
lib/Doctrine/DBAL/Events.php
+4
-4
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+16
-16
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+12
-12
No files found.
lib/Doctrine/DBAL/Event/SchemaAlterTableAdd
ed
ColumnEventArgs.php
→
lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php
View file @
6abba72f
...
...
@@ -35,7 +35,7 @@ use Doctrine\Common\EventArgs,
* @version $Revision$
* @author Jan Sorgalla <jsorgalla@googlemail.com>
*/
class
SchemaAlterTableAdd
ed
ColumnEventArgs
extends
SchemaEventArgs
class
SchemaAlterTableAddColumnEventArgs
extends
SchemaEventArgs
{
/**
* @var Column
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableChange
d
ColumnEventArgs.php
→
lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
View file @
6abba72f
...
...
@@ -35,7 +35,7 @@ use Doctrine\Common\EventArgs,
* @version $Revision$
* @author Jan Sorgalla <jsorgalla@googlemail.com>
*/
class
SchemaAlterTableChange
d
ColumnEventArgs
extends
SchemaEventArgs
class
SchemaAlterTableChangeColumnEventArgs
extends
SchemaEventArgs
{
/**
* @var ColumnDiff
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableRemove
d
ColumnEventArgs.php
→
lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php
View file @
6abba72f
...
...
@@ -35,7 +35,7 @@ use Doctrine\Common\EventArgs,
* @version $Revision$
* @author Jan Sorgalla <jsorgalla@googlemail.com>
*/
class
SchemaAlterTableRemove
d
ColumnEventArgs
extends
SchemaEventArgs
class
SchemaAlterTableRemoveColumnEventArgs
extends
SchemaEventArgs
{
/**
* @var Column
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableRename
d
ColumnEventArgs.php
→
lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php
View file @
6abba72f
...
...
@@ -35,7 +35,7 @@ use Doctrine\Common\EventArgs,
* @version $Revision$
* @author Jan Sorgalla <jsorgalla@googlemail.com>
*/
class
SchemaAlterTableRename
d
ColumnEventArgs
extends
SchemaEventArgs
class
SchemaAlterTableRenameColumnEventArgs
extends
SchemaEventArgs
{
/**
* @var string
...
...
lib/Doctrine/DBAL/Events.php
View file @
6abba72f
...
...
@@ -38,9 +38,9 @@ final class Events
const
onSchemaCreateTable
=
'onSchemaCreateTable'
;
const
onSchemaCreateTableColumn
=
'onSchemaCreateTableColumn'
;
const
onSchemaDropTable
=
'onSchemaDropTable'
;
const
onSchemaAlterTableAdd
edColumn
=
'onSchemaAlterTableAdde
dColumn'
;
const
onSchemaAlterTableRemove
dColumn
=
'onSchemaAlterTableRemoved
Column'
;
const
onSchemaAlterTableChange
dColumn
=
'onSchemaAlterTableChanged
Column'
;
const
onSchemaAlterTableRename
dColumn
=
'onSchemaAlterTableRenamed
Column'
;
const
onSchemaAlterTableAdd
Column
=
'onSchemaAlterTableAd
dColumn'
;
const
onSchemaAlterTableRemove
Column
=
'onSchemaAlterTableRemove
Column'
;
const
onSchemaAlterTableChange
Column
=
'onSchemaAlterTableChange
Column'
;
const
onSchemaAlterTableRename
Column
=
'onSchemaAlterTableRename
Column'
;
const
onSchemaColumnDefinition
=
'onSchemaColumnDefinition'
;
}
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
6abba72f
...
...
@@ -22,10 +22,10 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\Schema\TableDiff
,
Doctrine\DBAL\Schema\Table
,
Doctrine\DBAL\Events
,
Doctrine\DBAL\Event\SchemaAlterTableAdd
ed
ColumnEventArgs
,
Doctrine\DBAL\Event\SchemaAlterTableRemove
d
ColumnEventArgs
,
Doctrine\DBAL\Event\SchemaAlterTableChange
d
ColumnEventArgs
,
Doctrine\DBAL\Event\SchemaAlterTableRename
d
ColumnEventArgs
;
Doctrine\DBAL\Event\SchemaAlterTableAddColumnEventArgs
,
Doctrine\DBAL\Event\SchemaAlterTableRemoveColumnEventArgs
,
Doctrine\DBAL\Event\SchemaAlterTableChangeColumnEventArgs
,
Doctrine\DBAL\Event\SchemaAlterTableRenameColumnEventArgs
;
/**
* PostgreSqlPlatform.
...
...
@@ -388,9 +388,9 @@ class PostgreSqlPlatform extends AbstractPlatform
$columnSql
=
array
();
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableAdd
ed
Column
))
{
$eventArgs
=
new
SchemaAlterTableAdd
ed
ColumnEventArgs
(
$column
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableAdd
ed
Column
,
$eventArgs
);
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableAddColumn
))
{
$eventArgs
=
new
SchemaAlterTableAddColumnEventArgs
(
$column
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableAddColumn
,
$eventArgs
);
$columnSql
=
array_merge
(
$columnSql
,
$eventArgs
->
getSql
());
...
...
@@ -407,9 +407,9 @@ class PostgreSqlPlatform extends AbstractPlatform
}
foreach
(
$diff
->
removedColumns
as
$column
)
{
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRemove
d
Column
))
{
$eventArgs
=
new
SchemaAlterTableRemove
d
ColumnEventArgs
(
$column
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableRemove
d
Column
,
$eventArgs
);
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRemoveColumn
))
{
$eventArgs
=
new
SchemaAlterTableRemoveColumnEventArgs
(
$column
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableRemoveColumn
,
$eventArgs
);
$columnSql
=
array_merge
(
$columnSql
,
$eventArgs
->
getSql
());
...
...
@@ -423,9 +423,9 @@ class PostgreSqlPlatform extends AbstractPlatform
}
foreach
(
$diff
->
changedColumns
AS
$columnDiff
)
{
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableChange
d
Column
))
{
$eventArgs
=
new
SchemaAlterTableChange
d
ColumnEventArgs
(
$columnDiff
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableChange
d
Column
,
$eventArgs
);
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableChangeColumn
))
{
$eventArgs
=
new
SchemaAlterTableChangeColumnEventArgs
(
$columnDiff
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableChangeColumn
,
$eventArgs
);
$columnSql
=
array_merge
(
$columnSql
,
$eventArgs
->
getSql
());
...
...
@@ -473,9 +473,9 @@ class PostgreSqlPlatform extends AbstractPlatform
}
foreach
(
$diff
->
renamedColumns
as
$oldColumnName
=>
$column
)
{
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRename
d
Column
))
{
$eventArgs
=
new
SchemaAlterTableRename
d
ColumnEventArgs
(
$oldColumnName
,
$column
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableRename
d
Column
,
$eventArgs
);
if
(
null
!==
$this
->
_eventManager
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRenameColumn
))
{
$eventArgs
=
new
SchemaAlterTableRenameColumnEventArgs
(
$oldColumnName
,
$column
,
$diff
,
$this
);
$this
->
_eventManager
->
dispatchEvent
(
Events
::
onSchemaAlterTableRenameColumn
,
$eventArgs
);
$columnSql
=
array_merge
(
$columnSql
,
$eventArgs
->
getSql
());
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
6abba72f
...
...
@@ -219,32 +219,32 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
public
function
testGetAlterTableSqlDispatchEvent
()
{
$events
=
array
(
'onSchemaAlterTableAdd
ed
Column'
,
'onSchemaAlterTableRemove
d
Column'
,
'onSchemaAlterTableChange
d
Column'
,
'onSchemaAlterTableRename
d
Column'
'onSchemaAlterTableAddColumn'
,
'onSchemaAlterTableRemoveColumn'
,
'onSchemaAlterTableChangeColumn'
,
'onSchemaAlterTableRenameColumn'
);
$listenerMock
=
$this
->
getMock
(
'GetAlterTableSqlDispatchEvenListener'
,
$events
);
$listenerMock
->
expects
(
$this
->
once
())
->
method
(
'onSchemaAlterTableAdd
ed
Column'
);
->
method
(
'onSchemaAlterTableAddColumn'
);
$listenerMock
->
expects
(
$this
->
once
())
->
method
(
'onSchemaAlterTableRemove
d
Column'
);
->
method
(
'onSchemaAlterTableRemoveColumn'
);
$listenerMock
->
expects
(
$this
->
once
())
->
method
(
'onSchemaAlterTableChange
d
Column'
);
->
method
(
'onSchemaAlterTableChangeColumn'
);
$listenerMock
->
expects
(
$this
->
once
())
->
method
(
'onSchemaAlterTableRename
d
Column'
);
->
method
(
'onSchemaAlterTableRenameColumn'
);
$eventManager
=
new
EventManager
();
$events
=
array
(
Events
::
onSchemaAlterTableAdd
ed
Column
,
Events
::
onSchemaAlterTableRemove
d
Column
,
Events
::
onSchemaAlterTableChange
d
Column
,
Events
::
onSchemaAlterTableRename
d
Column
Events
::
onSchemaAlterTableAddColumn
,
Events
::
onSchemaAlterTableRemoveColumn
,
Events
::
onSchemaAlterTableChangeColumn
,
Events
::
onSchemaAlterTableRenameColumn
);
$eventManager
->
addEventListener
(
$events
,
$listenerMock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment