PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.1.1
Kirki – Freeform Page Builder, Website Builder & Customizer v6.1.1
6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Database / Connection / DatabaseManager.php
kirki / libraries / framework / Database / Connection Last commit date
Connection.php 3 weeks ago DatabaseManager.php 3 weeks ago
DatabaseManager.php
72 lines
1 <?php
2
3 /**
4 * The DatabaseManager class provides a high-level interface for managing database transactions.
5 * This class acts as a facade for transaction management, allowing you to
6 * begin, commit, and rollback transactions using the underlying database connection.
7 * It is designed to simplify transaction handling and ensure consistency across database operations.
8 *
9 * @package Framework
10 * @subpackage Database\Connection
11 * @since 1.0.0
12 */
13 namespace Kirki\Framework\Database\Connection;
14
15 \defined('ABSPATH') || exit;
16 use Kirki\Framework\Supports\Traits\Macroable;
17 class DatabaseManager
18 {
19 use Macroable {
20 __call as macroCall;
21 }
22 /**
23 * The database connection instance.
24 *
25 * @var Connection
26 *
27 * @since 1.0.0
28 */
29 protected $connection;
30 /**
31 * Initialize a new DatabaseManager instance with a database connection.
32 *
33 * @param Connection $connection The database connection instance.
34 *
35 * @return void
36 *
37 * @since 1.0.0
38 */
39 public function __construct(Connection $connection)
40 {
41 $this->connection = $connection;
42 }
43 /**
44 * Get the database connection instance
45 *
46 * @return Connection The database connection instance
47 *
48 * @since 1.0.0
49 */
50 public function connection()
51 {
52 return $this->connection;
53 }
54 /**
55 * Call a method on the database connection
56 *
57 * @param string $method The method name
58 * @param array $arguments The arguments for the method
59 *
60 * @return mixed The result of the method call
61 *
62 * @since 1.0.0
63 */
64 public function __call($method, $arguments)
65 {
66 if (static::has_macro($method)) {
67 return $this->macroCall($method, $arguments);
68 }
69 return $this->connection->{$method}(...$arguments);
70 }
71 }
72