One approach:
define a static array in your entity for example:
<?php
class Entity
{
public static $chargeStatusList = array(
"0" => "Ninguno",
"1" => "Proceso de Fabricacion",
"2" => "Pickup en destino",
"3" => "A la espera de recojo por cliente",
"4" => "Carga en transito",
"5" => "Carga arribada",
"6" => "En proceso de aduana",
"7" => "Entregado a cliente",
"8" => "En bodega"
);
public function getChargeStatusValue()
{
return self::$chargeStatus[$this->charge_status];
}
}
In your Admin class
class YourAdmin extends Admin
{
....
use Path/To/Your/Entity;
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->add('chargeStatusValue', 'string', array('label' => 'Charge status'))
;
}
protected function configureFormFields(FormMapper $form)
{
....
->add('charge_status', 'choice', array('choices' => Entity::$chargeStatusList));
....
}
}