FEATURE #1507: modularize content management

This commit is contained in:
Michal Kváček
2016-03-11 15:43:11 +01:00
parent 3407707046
commit 9f5bd46ca3
23 changed files with 1018 additions and 19 deletions
@@ -0,0 +1,18 @@
<?php
namespace App\Enumerations;
use App\Models\Content;
class ActiveContentStatuses extends BaseEnumeration
{
protected static function init()
{
foreach (ContentStatuses::getWithTranslations() as $key => $value) {
if ($key == Content::STATUS_DELETED) {
continue;
}
self::push($key, $value);
}
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Enumerations;
use App\Models\Module;
class ModuleNamesWithIds extends BaseEnumeration
{
/**
* Init list of all installed modules
*
* @throws Exceptions\EnumerationExistsException
*/
protected static function init()
{
$modules = Module::all(['id', 'name']);
foreach ($modules as $module) {
self::push($module->id, $module->name);
}
}
}