53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Enums\Products;
|
|
|
|
use App\Traits\Enums\BaseEnum;
|
|
|
|
enum CertificationsEnum: int
|
|
{
|
|
use BaseEnum;
|
|
|
|
case haltungsform3 = 3;
|
|
case haltungsform4 = 4;
|
|
case ecc = 5;
|
|
case nutriscoreA = 6;
|
|
case nutriscoreB = 7;
|
|
case nutriscoreC = 8;
|
|
case nutriscoreD = 9;
|
|
case nutriscoreE = 10;
|
|
|
|
/**
|
|
* Custom added images definition
|
|
*/
|
|
private const IMAGES = [
|
|
self::haltungsform3->name => "haltungsform3.png",
|
|
self::haltungsform4->name => "haltungsform4.png",
|
|
self::ecc->name => "ECC-Logo-green.svg",
|
|
self::nutriscoreA->name => "nutriscore-a.png",
|
|
self::nutriscoreB->name => "nutriscore-b.png",
|
|
self::nutriscoreC->name => "nutriscore-c.png",
|
|
self::nutriscoreD->name => "nutriscore-d.png",
|
|
self::nutriscoreE->name => "nutriscore-e.png",
|
|
];
|
|
|
|
/**
|
|
* Get image
|
|
*
|
|
* @return string
|
|
*/
|
|
public function image(): string
|
|
{
|
|
return self::IMAGES[$this->name];
|
|
}
|
|
|
|
/**
|
|
* Get enum images
|
|
*
|
|
* @return array<string>
|
|
*/
|
|
public static function toImages(): array
|
|
{
|
|
return self::IMAGES;
|
|
}
|
|
}
|