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
aa996d3a
Commit
aa996d3a
authored
Feb 10, 2016
by
Claudio Zizza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation of onSchemaCreateTableColumn, onSchemaDropTable and onSchemaAlterTable
parent
ea473f7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
14 deletions
+81
-14
events.rst
docs/en/reference/events.rst
+81
-14
No files found.
docs/en/reference/events.rst
View file @
aa996d3a
...
...
@@ -70,8 +70,9 @@ OnSchemaCreateTable Event
^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::onSchemaCreateTable`` is triggered before every
create statement that is executed by one of the Platform instances and gets
an instance of ``Doctrine\DBAL\Event\SchemaCreateTableEventArgs`` as event argument.
create statement that is executed by one of the Platform instances and injects
an instance of ``Doctrine\DBAL\Event\SchemaCreateTableEventArgs`` as event argument
for event listeners.
.. code-block:: php
...
...
@@ -85,55 +86,121 @@ an instance of ``Doctrine\DBAL\Event\SchemaCreateTableEventArgs`` as event argum
}
$evm = new EventManager();
$evm->addEventListener(
'onSchemaCreateTable'
, new MyEventListener());
$evm->addEventListener(
Events::onSchemaCreateTable
, new MyEventListener());
$conn = DriverManager::getConnection($connectionParams, null, $evm);
It allows you to access the ``Doctrine\DBAL\Schema\Table`` instance
s
and its columns, the used Platform and
provides a way to add
your own
SQL statements.
It allows you to access the ``Doctrine\DBAL\Schema\Table`` instance and its columns, the used Platform and
provides a way to add
additional
SQL statements.
OnSchemaCreateTableColumn Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::postConnect`` is triggered
``Doctrine\DBAL\Events::onSchemaCreateTableColumn`` is triggered before a column
create statement that is executed by one of the Platform instances and injects
an instance of ``Doctrine\DBAL\Event\SchemaCreateTableColumnEventArgs`` as event argument
for event listeners.
.. code-block:: php
<?php
class MyEventListener
{
public function onSchemaCreateTableColumn(SchemaCreateTableColumnEventArgs $event)
{
// Your EventListener code
}
}
$evm = new EventManager();
$evm->addEventListener(Events::onSchemaCreateTableColumn, new MyEventListener());
$conn = DriverManager::getConnection($connectionParams, null, $evm);
It allows you to access the ``Doctrine\DBAL\Schema\Table`` instance and its columns, the used Platform and
provides a way to add additional SQL statements.
OnSchemaDropTable Event
^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::postConnect`` is triggered
``Doctrine\DBAL\Events::onSchemaDropTable`` is triggered before a drop table
statement that is executed by one of the Platform instances and injects
an instance of ``Doctrine\DBAL\Event\SchemaDropTableEventArgs`` as event argument
for event listeners.
.. code-block:: php
<?php
class MyEventListener
{
public function onSchemaDropTable(SchemaDropTableEventArgs $event)
{
// Your EventListener code
}
}
$evm = new EventManager();
$evm->addEventListener(Events::onSchemaDropTable, new MyEventListener());
$conn = DriverManager::getConnection($connectionParams, null, $evm);
It allows you to access the ``Doctrine\DBAL\Schema\Table`` instance, the used Platform and
provides a way to set an additional SQL statement.
OnSchemaAlterTable Event
^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::postConnect`` is triggered
``Doctrine\DBAL\Events::onSchemaAlterTable`` is triggered before every
alter statement that is executed by one of the Platform instances and injects
an instance of ``Doctrine\DBAL\Event\SchemaAlterTableEventArgs`` as event argument
for event listeners.
.. code-block:: php
<?php
class MyEventListener
{
public function onSchemaAlterTable(SchemaAlterTableEventArgs $event)
{
// Your EventListener code
}
}
$evm = new EventManager();
$evm->addEventListener(Events::onSchemaAlterTable, new MyEventListener());
$conn = DriverManager::getConnection($connectionParams, null, $evm);
It allows you to access the ``Doctrine\DBAL\Schema\TableDiff`` instance, the used Platform and
provides a way to add additional SQL statements.
OnSchemaAlterTableAddColumn Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::
postConnect
`` is triggered
``Doctrine\DBAL\Events::
onSchemaAlterTableAddColumn
`` is triggered
OnSchemaAlterTableRemoveColumn Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::
postConnect
`` is triggered
``Doctrine\DBAL\Events::
onSchemaAlterTableRemoveColumn
`` is triggered
OnSchemaAlterTableChangeColumn Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::
postConnect
`` is triggered
``Doctrine\DBAL\Events::
onSchemaAlterTableChangeColumn
`` is triggered
OnSchemaAlterTableRenameColumn Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::
postConnect
`` is triggered
``Doctrine\DBAL\Events::
onSchemaAlterTableRenameColumn
`` is triggered
OnSchemaColumnDefinition Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::
postConnect
`` is triggered
``Doctrine\DBAL\Events::
onSchemaColumnDefinition
`` is triggered
OnSchemaIndexDefinition Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::
postConnect
`` is triggered
``Doctrine\DBAL\Events::
onSchemaIndexDefinition
`` is triggered
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