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
7f14180b
Commit
7f14180b
authored
Feb 18, 2016
by
Claudio Zizza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add description for onSchemaColumnDefinition and onSchemaIndexDefinition
parent
afe281f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
4 deletions
+48
-4
events.rst
docs/en/reference/events.rst
+48
-4
No files found.
docs/en/reference/events.rst
View file @
7f14180b
...
...
@@ -54,14 +54,14 @@ methods must be named like the events itself.
<?php
$evm = new EventManager();
$eventName =
'onSchemaCreateTable'
;
$eventName =
Events::onSchemaCreateTable
;
$evm->addEventListener($eventName, new MyEventListener());
.. code-block:: php
<?php
$evm = new EventManager();
$eventNames = array(
'onSchemaCreateTable', 'onSchemaCreateTableColumn'
);
$eventNames = array(
Events::onSchemaCreateTable, Events::onSchemaCreateTableColumn
);
$evm->addEventListener($eventNames, new MyEventListener());
The following events are available.
...
...
@@ -287,9 +287,53 @@ a way to add additional SQL statements.
OnSchemaColumnDefinition Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::onSchemaColumnDefinition`` is triggered
``Doctrine\DBAL\Events::onSchemaColumnDefinition`` is triggered on a schema update and is
executed for every existing column definition of the database before changes are applied.
An instance of ``Doctrine\DBAL\Event\SchemaColumnDefinitionEventArgs`` is injected as argument
for event listeners.
.. code-block:: php
<?php
class MyEventListener
{
public function onSchemaColumnDefinition(SchemaColumnDefinitionEventArgs $event)
{
// Your EventListener code
}
}
$evm = new EventManager();
$evm->addEventListener(Events::onSchemaColumnDefinition, new MyEventListener());
$conn = DriverManager::getConnection($connectionParams, null, $evm);
It allows you to access the table column definitions of the current database, table name, Platform and
``Doctrine\DBAL\Connection`` instance.
OnSchemaIndexDefinition Event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``Doctrine\DBAL\Events::onSchemaIndexDefinition`` is triggered
``Doctrine\DBAL\Events::onSchemaIndexDefinition`` is triggered on a schema update and is
executed for every existing index definition of the database before changes are applied.
An instance of ``Doctrine\DBAL\Event\SchemaIndexDefinitionEventArgs`` is injected as argument
for event listeners.
.. code-block:: php
<?php
class MyEventListener
{
public function onSchemaIndexDefinition(SchemaIndexDefinitionEventArgs $event)
{
// Your EventListener code
}
}
$evm = new EventManager();
$evm->addEventListener(Events::onSchemaIndexDefinition, new MyEventListener());
$conn = DriverManager::getConnection($connectionParams, null, $evm);
It allows you to access the table index definitions of the current database, table name, Platform and
``Doctrine\DBAL\Connection`` instance.
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