registerClientRepository(); } /** * Register client role if it doesn't exist */ public function registerClientRole() { $role = get_role('customer'); if (!$role) { add_role('customer', __('Customer', 'easy-invoice'), [ 'read' => true, ]); } } /** * Register client repository */ protected function registerClientRepository() { // Create and store the repository instance self::$repository = new ClientRepository(); } /** * Get the client repository * * @return ClientRepositoryInterface The client repository */ public static function getClientRepository() { // Create the repository if it doesn't exist if (self::$repository === null) { self::$repository = new ClientRepository(); } return self::$repository; } }