Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
PluginUtility
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 removePlugin
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\App\Models\Domain;
6
7use PeServer\App\Models\Dao\Entities\PluginCategoryMappingsEntityDao;
8use PeServer\App\Models\Dao\Entities\PluginsEntityDao;
9use PeServer\App\Models\Dao\Entities\PluginUrlsEntityDao;
10use PeServer\Core\Database\IDatabaseContext;
11
12abstract class PluginUtility
13{
14    public static function removePlugin(IDatabaseContext $database, string $pluginId): void
15    {
16        $pluginsEntityDao = new PluginsEntityDao($database);
17        $pluginUrlsEntityDao = new PluginUrlsEntityDao($database);
18        $pluginCategoryMappingsEntityDao = new PluginCategoryMappingsEntityDao($database);
19
20        $pluginCategoryMappingsEntityDao->deletePluginCategoryMappings($pluginId);
21        $pluginUrlsEntityDao->deleteByPluginId($pluginId);
22        $pluginsEntityDao->deletePlugin($pluginId);
23    }
24}