From 22eb21deb0e14397ae2f6fa6d7d50fb83cbd3889 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <1+jmiller@noreply.git.mokoconsulting.tech> Date: Sat, 27 Jun 2026 20:20:04 +0000 Subject: [PATCH] feat: add system plugin service provider --- .../services/provider.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 source/plg_system_mokosuitebooking/services/provider.php diff --git a/source/plg_system_mokosuitebooking/services/provider.php b/source/plg_system_mokosuitebooking/services/provider.php new file mode 100644 index 0000000..ca6e7c7 --- /dev/null +++ b/source/plg_system_mokosuitebooking/services/provider.php @@ -0,0 +1,35 @@ + + * @license GPL-3.0-or-later + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Extension\PluginInterface; +use Joomla\CMS\Factory; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Event\DispatcherInterface; +use Moko\Plugin\System\MokoSuiteBooking\Extension\Booking; + +return new class () implements ServiceProviderInterface { + public function register(Container $container): void + { + $container->set( + PluginInterface::class, + function (Container $container) { + $dispatcher = $container->get(DispatcherInterface::class); + $plugin = new Booking( + $dispatcher, + (array) PluginHelper::getPlugin('system', 'mokosuitebooking') + ); + $plugin->setApplication(Factory::getApplication()); + + return $plugin; + } + ); + } +};