41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Models\DocumentationCategoryContent;
|
|
use App\Models\DocumentationContent;
|
|
use App\Models\Project;
|
|
use App\Models\ProjectContent;
|
|
|
|
enum Morph: int
|
|
{
|
|
case Project = 1;
|
|
case DocumentationContent = 2;
|
|
case ProjectContent = 3;
|
|
case DocumentationCategoryContent = 4;
|
|
|
|
public function getPathModel(): string
|
|
{
|
|
return match ($this) {
|
|
self::Project => Project::class,
|
|
self::DocumentationContent => DocumentationContent::class,
|
|
self::ProjectContent => ProjectContent::class,
|
|
self::DocumentationCategoryContent => DocumentationCategoryContent::class,
|
|
};
|
|
}
|
|
|
|
public function getFolderName(): string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public static function map(): array
|
|
{
|
|
$map = [];
|
|
foreach (self::cases() as $item) {
|
|
$map[$item->value] = $item->getPathModel();
|
|
}
|
|
return $map;
|
|
}
|
|
}
|