[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Adapter/ -> AdapterInstance.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2008 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Adapter;
  11  
  12  use Joomla\CMS\Factory;
  13  use Joomla\CMS\Object\CMSObject;
  14  use Joomla\Database\DatabaseDriver;
  15  
  16  // phpcs:disable PSR1.Files.SideEffects
  17  \defined('JPATH_PLATFORM') or die;
  18  // phpcs:enable PSR1.Files.SideEffects
  19  
  20  /**
  21   * Adapter Instance Class
  22   *
  23   * @since       1.6
  24   * @deprecated  5.0 Will be removed without replacement
  25   */
  26  class AdapterInstance extends CMSObject
  27  {
  28      /**
  29       * Parent
  30       *
  31       * @var    Adapter
  32       * @since  1.6
  33       */
  34      protected $parent = null;
  35  
  36      /**
  37       * Database
  38       *
  39       * @var    DatabaseDriver
  40       * @since  1.6
  41       */
  42      protected $db = null;
  43  
  44      /**
  45       * Constructor
  46       *
  47       * @param   Adapter         $parent   Parent object
  48       * @param   DatabaseDriver  $db       Database object
  49       * @param   array           $options  Configuration Options
  50       *
  51       * @since   1.6
  52       */
  53      public function __construct(Adapter $parent, DatabaseDriver $db, array $options = array())
  54      {
  55          // Set the properties from the options array that is passed in
  56          $this->setProperties($options);
  57  
  58          // Set the parent and db in case $options for some reason overrides it.
  59          $this->parent = $parent;
  60  
  61          // Pull in the global dbo in case something happened to it.
  62          $this->db = $db ?: Factory::getDbo();
  63      }
  64  
  65      /**
  66       * Retrieves the parent object
  67       *
  68       * @return  Adapter
  69       *
  70       * @since   1.6
  71       */
  72      public function getParent()
  73      {
  74          return $this->parent;
  75      }
  76  }


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