commit d6cc9e4c97dd4e66d6c53f413770b39aa49ca78f
parent 0c73fb3e3f9f7dfb11714cc5444253ca1739e662
Author: Felicitus <felicitus@felicitus.org>
Date: Thu, 23 Jul 2015 21:44:20 +0200
Fixed one to one association generator
Diffstat:
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/PartKeepr/DoctrineReflectionBundle/Resources/views/model.js.twig b/src/PartKeepr/DoctrineReflectionBundle/Resources/views/model.js.twig
@@ -17,6 +17,15 @@ Ext.define('{{ className }}', {
{% endfor %}
{% endif %}
+ {% if associations.ONE_TO_ONE|length > 0 %}
+ ,
+ {% for association in associations.ONE_TO_ONE %}
+ { name: '{{ association.name }}',
+ reference: '{{ association.target }}'
+ }{% if not loop.last %},{% endif %}
+
+ {% endfor %}
+ {% endif %}
],
@@ -33,20 +42,6 @@ Ext.define('{{ className }}', {
],
{% endif %}
- {% if associations.ONE_TO_ONE|length > 0 %}
- hasOne: [
- {% for association in associations.ONE_TO_ONE %}
- {
- name: '{{ association.name }}',
- associationKey: '{{ association.name }}',
- model: '{{ association.target }}'
- }{% if not loop.last %},{% endif %}
-
- {% endfor %}
- ],
- {% endif %}
-
-
{% if associations.MANY_TO_MANY|length > 0 %}
manyToMany: {
{% for association in associations.MANY_TO_MANY %}