ConnectionEventArgs.php 1.08 KB
Newer Older
1 2 3 4
<?php

namespace Doctrine\DBAL\Event;

Benjamin Morel's avatar
Benjamin Morel committed
5 6
use Doctrine\Common\EventArgs;
use Doctrine\DBAL\Connection;
7 8 9
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
10 11 12 13 14 15

/**
 * Event Arguments used when a Driver connection is established inside Doctrine\DBAL\Connection.
 */
class ConnectionEventArgs extends EventArgs
{
16
    /** @var Connection */
17
    private $connection;
18 19 20

    public function __construct(Connection $connection)
    {
21
        $this->connection = $connection;
22 23 24
    }

    /**
25
     * @return Connection
26 27 28
     */
    public function getConnection()
    {
29
        return $this->connection;
30 31 32
    }

    /**
33
     * @return Driver
34 35 36
     */
    public function getDriver()
    {
37
        return $this->connection->getDriver();
38 39 40
    }

    /**
41
     * @return AbstractPlatform
42 43 44
     */
    public function getDatabasePlatform()
    {
45
        return $this->connection->getDatabasePlatform();
46 47 48
    }

    /**
49
     * @return AbstractSchemaManager
50 51 52
     */
    public function getSchemaManager()
    {
53
        return $this->connection->getSchemaManager();
54 55
    }
}