PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.3.4
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.3.4
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / includes / Providers / InvoiceServiceProvider.php

InvoiceServiceProvider.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.3.4, at includes/Providers/InvoiceServiceProvider.php

80 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Invoice Service Provider
4 *
5 * @package Easy_Invoice
6 * @subpackage Providers
7 */
8
9 namespace EasyInvoice\Providers;
10
11 use EasyInvoice\Interfaces\InvoiceRepositoryInterface;
12 use EasyInvoice\Repositories\InvoiceRepository;
13
14 /**
15 * InvoiceServiceProvider Class
16 *
17 * Handles the registration of invoice-related services.
18 */
19 class InvoiceServiceProvider {
20 /**
21 * The repository instance
22 *
23 * @var InvoiceRepositoryInterface
24 */
25 protected static $repository = null;
26
27 /**
28 * Register invoice services
29 */
30 public function register() {
31 // Register service providers, load dependencies, etc.
32 $this->registerRepositories();
33 $this->registerHooks();
34 }
35
36 /**
37 * Register repositories
38 */
39 protected function registerRepositories() {
40 // This method would be more useful if you're using a dependency injection container
41 // For now, it's just a placeholder to maintain structure for future expansion
42 }
43
44 /**
45 * Register hooks
46 */
47 protected function registerHooks() {
48 // Register any WordPress hooks related to invoices
49 // Removed duplicate textdomain loading - it's handled in the main plugin file
50 }
51
52 /**
53 * Load text domain
54 */
55 public function loadTextDomain() {
56 // Removed - textdomain is loaded in the main plugin file
57 }
58
59 /**
60 * Register invoice repository
61 */
62 protected function registerInvoiceRepository() {
63 // Create and store the repository instance
64 self::$repository = new InvoiceRepository();
65 }
66
67 /**
68 * Get the invoice repository
69 *
70 * @return InvoiceRepositoryInterface The invoice repository
71 */
72 public static function getInvoiceRepository() {
73 // Create the repository if it doesn't exist
74 if (self::$repository === null) {
75 self::$repository = new InvoiceRepository();
76 }
77
78 return self::$repository;
79 }
80 }