Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
adapterinstance.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Base
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Adapter Instance Class
14  *
15  * @package Joomla.Platform
16  * @subpackage Base
17  * @since 11.1
18  */
20 {
21  /**
22  * Parent
23  *
24  * @var JAdapter
25  * @since 11.1
26  */
27  protected $parent = null;
28 
29  /**
30  * Database
31  *
32  * @var JDatabaseDriver
33  * @since 11.1
34  */
35  protected $db = null;
36 
37  /**
38  * Constructor
39  *
40  * @param JAdapter $parent Parent object
41  * @param JDatabaseDriver $db Database object
42  * @param array $options Configuration Options
43  *
44  * @since 11.1
45  */
46  public function __construct(JAdapter $parent, JDatabaseDriver $db, array $options = array())
47  {
48  // Set the properties from the options array that is passed in
49  $this->setProperties($options);
50 
51  // Set the parent and db in case $options for some reason overrides it.
52  $this->parent = $parent;
53 
54  // Pull in the global dbo in case something happened to it.
55  $this->db = $db ?: JFactory::getDbo();
56  }
57 
58  /**
59  * Retrieves the parent object
60  *
61  * @return JAdapter parent
62  *
63  * @since 11.1
64  */
65  public function getParent()
66  {
67  return $this->parent;
68  }
69 }