The template has this data(the result of {{ dump(extra) }}
)
array (size=4)
0 =>
object(MyProject\Entity\Translation)[210]
private 'language' =>
object(Proxies\__CG__\MyProject\Entity\Language)[225]
public '__initializer__' => null
public '__cloner__' => null
public '__isInitialized__' => boolean true
private 'code' (MyProject\Entity\Language) => string 'es' (length=2)
private 'id' (MyProject\Entity\Language) => int 70
private 'entity' => string 'Reason' (length=6)
private 'entityId' => int 10000
private 'field' => string 'text' (length=4)
private 'text' => string 'No quiero recibir emails' (length=24)
1 =>
object(MyProject\Entity\Translation)[224]
private 'language' =>
object(Proxies\__CG__\MyProject\Entity\Language)[225]
public '__initializer__' => null
public '__cloner__' => null
public '__isInitialized__' => boolean true
private 'code' (MyProject\Entity\Language) => string 'es' (length=2)
private 'id' (MyProject\Entity\Language) => int 70
private 'entity' => string 'Reason' (length=6)
private 'entityId' => int 10001
private 'field' => string 'text' (length=4)
private 'text' => string 'No me gusta la web' (length=18)
2 =>
object(MyProject\Entity\Translation)[223]
private 'language' =>
object(Proxies\__CG__\MyProject\Entity\Language)[225]
public '__initializer__' => null
public '__cloner__' => null
public '__isInitialized__' => boolean true
private 'code' (MyProject\Entity\Language) => string 'es' (length=2)
private 'id' (MyProject\Entity\Language) => int 70
private 'entity' => string 'Reason' (length=6)
private 'entityId' => int 10002
private 'field' => string 'text' (length=4)
private 'text' => string 'No tengo ningún motivo' (length=23)
3 =>
object(MyProject\Entity\Translation)[221]
private 'language' =>
object(Proxies\__CG__\MyProject\Entity\Language)[225]
public '__initializer__' => null
public '__cloner__' => null
public '__isInitialized__' => boolean true
private 'code' (MyProject\Entity\Language) => string 'es' (length=2)
private 'id' (MyProject\Entity\Language) => int 70
private 'entity' => string 'Reason' (length=6)
private 'entityId' => int 10003
private 'field' => string 'text' (length=4)
private 'text' => string 'Otros' (length=5)
But I'm trying to access to the object properties but the options in the select are not printed.
{{ dump(extra) }}
<select id="motivos_baja" name="motivos_baja" class="form-control">
<option value="0" selected>Seleccione un motivo</option>
{% for extra in reason%}
<option value="{{ reason.getEntityId() }}">{{ reason.getText() }}</option>
{% endfor %}
</select>
The objects are doctrine
entities.