[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/database/src/Event/ -> ConnectionEvent.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Database Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Database\Event;
  10  
  11  use Joomla\Database\DatabaseInterface;
  12  use Joomla\Event\Event;
  13  
  14  /**
  15   * Database connection event
  16   *
  17   * @since  2.0.0
  18   */
  19  class ConnectionEvent extends Event
  20  {
  21      /**
  22       * DatabaseInterface object for this event
  23       *
  24       * @var    DatabaseInterface
  25       * @since  2.0.0
  26       */
  27      private $driver;
  28  
  29      /**
  30       * Constructor.
  31       *
  32       * @param   string             $name    The event name.
  33       * @param   DatabaseInterface  $driver  The DatabaseInterface object for this event.
  34       *
  35       * @since   2.0.0
  36       */
  37  	public function __construct(string $name, DatabaseInterface $driver)
  38      {
  39          parent::__construct($name);
  40  
  41          $this->driver = $driver;
  42      }
  43  
  44      /**
  45       * Retrieve the DatabaseInterface object attached to this event.
  46       *
  47       * @return  DatabaseInterface
  48       *
  49       * @since   2.0.0
  50       */
  51  	public function getDriver(): DatabaseInterface
  52      {
  53          return $this->driver;
  54      }
  55  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer