FEATURE: add enumeration for translating module handlers for their ids

This feature will need bit more optimalization. This is somehow weird approach.
This commit is contained in:
Michal Kváček
2016-03-09 22:11:49 +01:00
parent f79fc78868
commit a67417380f
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Enumerations;
use App\Models\Module;
class ModulesHandlerToId extends BaseEnumeration
{
/**
* Init list of all installed modules
*
* @throws Exceptions\EnumerationExistsException
*/
protected static function init()
{
$modules = Module::all(['handler', 'id']);
foreach ($modules as $module) {
self::push($module->handler, $module->id);
}
}
}