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; + } + ); + } +};