|
|
@@ -0,0 +1,30 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace Lc\SovBundle\Field; |
|
|
|
|
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait; |
|
|
|
use Lc\SovBundle\Form\Type\FileManagerType; |
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author La clic ! <contact@laclic.fr> |
|
|
|
*/ |
|
|
|
final class StatusField implements FieldInterface |
|
|
|
{ |
|
|
|
use FieldTrait; |
|
|
|
|
|
|
|
public static function new(string $propertyName, ?string $label = null): self |
|
|
|
{ |
|
|
|
return (new self()) |
|
|
|
->setProperty($propertyName) |
|
|
|
->setLabel($label) |
|
|
|
->setTemplatePath('@LcSov/adminlte/crud/field/status.html.twig') |
|
|
|
->setFormType(ChoiceType::class) |
|
|
|
->setFormTypeOption('expanded', false) |
|
|
|
->setFormTypeOption('multiple', false) |
|
|
|
->setFormTypeOption('choices', ['En ligne' => 1, 'Hors ligne' => 0]); |
|
|
|
} |
|
|
|
|
|
|
|
} |