mardi 24 février 2015

how represent type/status like array in entity

In symfony2 I have an entity Foo which has a field named $kind that can have some(at most about 10) different values(one at each time) something like this:



$kindArray('1' => 'type1', '2'=> 'type2');


and $kind field can get one of $kindArray indices.


I want one location that have $kindArray and use it for choiceType values when creating FooFormType.


how can I show it in entity? should I use array or something like value object?


Aucun commentaire:

Enregistrer un commentaire