PluginProbe
Packeta / 1.5.4
Packeta v1.5.4
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / src / Packetery / Module / WpdbAdapterFactory.php

WpdbAdapterFactory.php in Packeta 1.5.4, at src/Packetery/Module/WpdbAdapterFactory.php

38 lines 838 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class WpdbAdapterFactory
4 *
5 * @package Packetery
6 */
7
8 declare( strict_types=1 );
9
10 namespace Packetery\Module;
11
12 /**
13 * Class WpdbAdapterFactory
14 *
15 * @package Packetery
16 */
17 class WpdbAdapterFactory {
18
19 /**
20 * Creates WpdbAdapter instance
21 *
22 * @return WpdbAdapter
23 */
24 public function create(): WpdbAdapter {
25 global $wpdb;
26
27 $instance = new WpdbAdapter( $wpdb );
28 $instance->packetery_carrier = sprintf( '%scarrier', $instance->getPacketeryPrefix() );
29 $instance->packetery_order = sprintf( '%sorder', $instance->getPacketeryPrefix() );
30 $instance->packetery_log = sprintf( '%slog', $instance->getPacketeryPrefix() );
31 $instance->posts = $wpdb->posts;
32 $instance->options = $wpdb->options;
33 $instance->postmeta = $wpdb->postmeta;
34
35 return $instance;
36 }
37 }
38