Parcourir la source

Fix 129 - add more tolerance over non existant Admin class

Thomas Rabaix il y a 14 ans
Parent
commit
169a274027

+ 1 - 1
Admin/Admin.php

@@ -924,7 +924,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
 
         $admin = $pool->getAdminByClass($fieldDescription->getTargetEntity());
         if (!$admin) {
-            throw new \RuntimeException(sprintf('You must define an Admin class for the `%s` field (targetEntity=%s)', $fieldDescription->getFieldName(), $fieldDescription->getTargetEntity()));
+            return;
         }
 
         $fieldDescription->setAssociationAdmin($admin);

+ 3 - 1
Admin/AdminInterface.php

@@ -109,13 +109,15 @@ interface AdminInterface
 
     /**
      *
+     * @param mixed $object
+     * @param array $options
      * @return \Symfony\Component\Form\FormBuilder the form builder
      */
     function getFormBuilder($object = null, $options = array());
 
     /**
      * @abstract
-     * @param  $name
+     * @param string $name
      * @return \Sonata\AdminBundle\Admin\FieldDescriptionInterface
      */
     function getFormFieldDescription($name);

+ 8 - 0
Admin/BaseFieldDescription.php

@@ -319,6 +319,14 @@ abstract class BaseFieldDescription implements FieldDescriptionInterface
         return $this->associationAdmin;
     }
 
+    /**
+     *
+     * @return boolean
+     */
+    public function hasAssociationAdmin()
+    {
+        return $this->associationAdmin !== null;
+    }
 
     /**
      * return the value linked to the description

+ 6 - 7
Admin/Pool.php

@@ -66,7 +66,7 @@ class Pool
      * return the admin related to the given $class
      *
      * @param string $class
-     * @return \Sonata\AdminBundle\Admin\Admin|null
+     * @return \Sonata\AdminBundle\Admin\AdminInterface|null
      */
     public function getAdminByClass($class)
     {
@@ -78,11 +78,11 @@ class Pool
     }
 
     /**
-     * return an admin clas by its Admin code
+     * Returns an admin class by its Admin code
      * ie : sonata.news.admin.post|sonata.news.admin.comment => return the child class of post
      *
      * @param string $adminCode
-     * @return \Sonata\AdminBundle\Admin\Admin|null
+     * @return \Sonata\AdminBundle\Admin\AdminInterface|null
      */
     public function getAdminByAdminCode($adminCode)
     {
@@ -100,11 +100,10 @@ class Pool
     }
 
     /**
+     * Returns a new admin instance depends on the given code
      *
-     * return a new admin instance depends on the given code
-     *
-     * @param $code
-     * @return
+     * @param $id
+     * @return \Sonata\AdminBundle\Admin\AdminInterface
      */
     public function getInstance($id)
     {

+ 12 - 3
Builder/ORM/FormContractor.php

@@ -127,6 +127,10 @@ class FormContractor implements FormContractorInterface
      */
     protected function defineOneToOneField(FormBuilder $formBuilder, FieldDescriptionInterface $fieldDescription)
     {
+        if (!$fieldDescription->hasAssociationAdmin()) {
+            return;
+        }
+
         // tweak the widget depend on the edit mode
         if ($fieldDescription->getOption('edit') == 'inline') {
             return $this->defineChildFormBuilder($formBuilder, $fieldDescription);
@@ -154,6 +158,9 @@ class FormContractor implements FormContractorInterface
      */
     protected function getOneToManyField(FormBuilder $formBuilder, FieldDescriptionInterface $fieldDescription)
     {
+        if (!$fieldDescription->hasAssociationAdmin()) {
+            return;
+        }
 
         if ($fieldDescription->getOption('edit') == 'inline') {
 
@@ -193,6 +200,10 @@ class FormContractor implements FormContractorInterface
      */
     protected function defineManyToManyField(FormBuilder $formBuilder, FieldDescriptionInterface $fieldDescription)
     {
+        if (!$fieldDescription->hasAssociationAdmin()) {
+            return;
+        }
+
         $type     = $fieldDescription->getOption('form_field_type', 'sonata_type_model');
         $options  = $fieldDescription->getOption('form_field_options', array());
 
@@ -216,7 +227,6 @@ class FormContractor implements FormContractorInterface
      */
     public function addField(FormBuilder $formBuilder, FieldDescriptionInterface $fieldDescription)
     {
-
         // There is a bug in the GraphWalker, so for now we always load related associations
         // for more information : https://github.com/symfony/symfony/pull/1056
         if ($formBuilder->getData() && in_array($fieldDescription->getType(), array(ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::MANY_TO_MANY, ClassMetadataInfo::MANY_TO_ONE, ClassMetadataInfo::ONE_TO_ONE ))) {
@@ -264,8 +274,7 @@ class FormContractor implements FormContractorInterface
     {
         $fieldDescription->mergeOptions($options);
 
-        if ($admin->getModelManager()->hasMetadata($admin->getClass()))
-        {
+        if ($admin->getModelManager()->hasMetadata($admin->getClass())) {
             $metadata = $admin->getModelManager()->getMetadata($admin->getClass());
 
             // set the default field mapping

+ 24 - 22
Resources/views/CRUD/edit_orm_many_to_many.html.twig

@@ -12,28 +12,30 @@ file that was distributed with this source code.
 {% extends base_template %}
 
 {% block field %}
-    <div id="field_container_{{ field_element.vars.id }}">
-        <span id="field_widget_{{ field_element.vars.id }}" >
-            {{ form_widget(field_element) }}
-        </span>
-
-        <span id="field_actions_{{ field_element.vars.id }}" >
-            <a
-                href="{{ field_description.associationadmin.generateUrl('create') }}"
-                onclick="start_field_dialog_form_add_{{ field_element.vars.id }}(event)"
-                class="sonata-ba-action"
-                style="{% if not field_description.associationadmin.isGranted('CREATE')%}display:none{% endif %}"
-                >
-                    <img
-                        src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"
-                        alt="{% trans from 'SonataAdminBundle' %}btn_add{% endtrans %}"
-                    />
-            </a>
-        </span>
-
-        <div style="display: none" id="field_dialog_{{ field_element.vars.id }}">
+    {% if field_description.associationadmin %}
+        <div id="field_container_{{ field_element.vars.id }}">
+            <span id="field_widget_{{ field_element.vars.id }}" >
+                {{ form_widget(field_element) }}
+            </span>
+
+            <span id="field_actions_{{ field_element.vars.id }}" >
+                <a
+                    href="{{ field_description.associationadmin.generateUrl('create') }}"
+                    onclick="start_field_dialog_form_add_{{ field_element.vars.id }}(event)"
+                    class="sonata-ba-action"
+                    style="{% if not field_description.associationadmin.isGranted('CREATE')%}display:none{% endif %}"
+                    >
+                        <img
+                            src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"
+                            alt="{% trans from 'SonataAdminBundle' %}btn_add{% endtrans %}"
+                        />
+                </a>
+            </span>
+
+            <div style="display: none" id="field_dialog_{{ field_element.vars.id }}">
+            </div>
         </div>
-    </div>
 
-    {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
+        {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
+    {% endif %}
 {% endblock %}

+ 4 - 1
Resources/views/CRUD/edit_orm_many_to_one.html.twig

@@ -12,7 +12,10 @@ file that was distributed with this source code.
 {% extends base_template %}
 
 {% block field %}
-    {% if field_description.options.edit == 'inline' %}
+
+    {% if not field_description.hasassociationadmin%}
+        {{ value }}
+    {% elseif field_description.options.edit == 'inline' %}
         {% for nested_field_description in field_description.associationadmin.formfielddescriptions %}
             {{ nested_field_description|render_form_element(field_element, value) }}
         {% endfor %}

+ 117 - 113
Resources/views/CRUD/edit_orm_one_to_many.html.twig

@@ -12,132 +12,136 @@ file that was distributed with this source code.
 {% extends base_template %}
 
 {% block field %}
-    <div id="field_container_{{ field_element.vars.id }}">
-        <span id="field_widget_{{ field_element.vars.id }}" >
-            {% if field_description.options.edit == 'inline' %}
-                {% if inline == 'table' %}
-                    <table>
-                        <tbody class="sonata-ba-tbody">
+    {% if not field_description.hasassociationadmin%}
+        {# TODO : add logic here #}
+    {% else %}
+        <div id="field_container_{{ field_element.vars.id }}">
+            <span id="field_widget_{{ field_element.vars.id }}" >
+                {% if field_description.options.edit == 'inline' %}
+                    {% if inline == 'table' %}
+                        <table>
+                            <tbody class="sonata-ba-tbody">
+                                {% for nested_group_field_name, nested_group_field in field_element.children %}
+                                    <tr>
+                                        {% for field_name, nested_field in nested_group_field.children %}
+                                            <td class="sonata-ba-td-{{ field_element.vars.id }}-{{ field_name  }}">
+                                                {% if field_description.associationadmin.formfielddescriptions[field_name] is defined %}
+                                                    {{ field_description.associationadmin.formfielddescriptions[field_name]|render_form_element(
+                                                        nested_group_field,
+                                                        value[nested_group_field_name]
+                                                    ) }}
+
+                                                    {% set dummy = nested_group_field.setrendered %}
+                                                {% else %}
+                                                    {{ form_widget(nested_field) }}
+                                                {% endif %}
+                                            </td>
+                                        {% endfor %}
+                                    </tr>
+                                {% endfor %}
+                            </tbody>
+                        </table>
+                    {% else %}
+                        <div>
                             {% for nested_group_field_name, nested_group_field in field_element.children %}
-                                <tr>
-                                    {% for field_name, nested_field in nested_group_field.children %}
-                                        <td class="sonata-ba-td-{{ field_element.vars.id }}-{{ field_name  }}">
-                                            {% if field_description.associationadmin.formfielddescriptions[field_name] is defined %}
-                                                {{ field_description.associationadmin.formfielddescriptions[field_name]|render_form_element(
-                                                    nested_group_field,
-                                                    value[nested_group_field_name]
-                                                ) }}
-
-                                                {% set dummy = nested_group_field.setrendered %}
-                                            {% else %}
-                                                {{ form_widget(nested_field) }}
-                                            {% endif %}
-                                        </td>
-                                    {% endfor %}
-                                </tr>
+                                {% for field_name, nested_field in nested_group_field.children %}
+                                    {% if field_description.associationadmin.formfielddescriptions[field_name] is defined %}
+                                        {{ field_description.associationadmin.formfielddescriptions[field_name]|render_form_element(
+                                            nested_group_field,
+                                            value, {
+                                                'inline': 'natural',
+                                                'edit'  : 'inline'
+                                            }
+                                        ) }}
+
+                                        {% set dummy = nested_group_field.setrendered %}
+                                    {% else %}
+                                        {{ form_widget(nested_field) }}
+                                    {% endif %}
+                                {% endfor %}
                             {% endfor %}
-                        </tbody>
-                    </table>
+                        </div>
+                    {% endif %}
                 {% else %}
-                    <div>
-                        {% for nested_group_field_name, nested_group_field in field_element.children %}
-                            {% for field_name, nested_field in nested_group_field.children %}
-                                {% if field_description.associationadmin.formfielddescriptions[field_name] is defined %}
-                                    {{ field_description.associationadmin.formfielddescriptions[field_name]|render_form_element(
-                                        nested_group_field,
-                                        value, {
-                                            'inline': 'natural',
-                                            'edit'  : 'inline'
-                                        }
-                                    ) }}
-
-                                    {% set dummy = nested_group_field.setrendered %}
-                                {% else %}
-                                    {{ form_widget(nested_field) }}
-                                {% endif %}
-                            {% endfor %}
-                        {% endfor %}
-                    </div>
+                    {{ form_widget(field_element) }}
                 {% endif %}
-            {% else %}
-                {{ form_widget(field_element) }}
-            {% endif %}
 
-        </span>
-
-        {% if field_description.options.edit == 'inline' %}
-            <span id="field_actions_{{ field_element.vars.id }}" >
-                <a
-                    href="{{ field_description.associationadmin.generateUrl('create') }}"
-                    onclick="start_field_retrieve_{{ field_element.vars.id }}(event)"
-                    class="sonata-ba-action"
-                    style="{% if not field_description.associationadmin.isGranted('CREATE')%}display:none{% endif %}"
-                    >
-                    <img
-                        src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"
-                        alt="{% trans from 'SonataAdminBundle' %}btn_add{% endtrans %}"
-                     />
-                </a>
             </span>
 
-            {# add code for the sortable options #}
-            {% if field_description.options.sortable is defined %}
-                <script>
-                    jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody').sortable({
-                        axis: 'y',
-                        opacity: 0.6,
-                        items: 'tr',
-                        stop: apply_position_value_{{ field_element.vars.id }}
-                    });
-
-                    function apply_position_value_{{ field_element.vars.id }}() {
-                        // update the input value position
-                        jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ field_element.vars.id }}-position').each(function(index, element) {
-                            // remove the sortable handler and put it back
-                            jQuery('span.sonata-ba-sortable-handler', element).remove();
-                            jQuery(element).append('<span class="sonata-ba-sortable-handler ui-icon ui-icon-grip-solid-horizontal"></span>');
-                            jQuery('input', element).hide();
+            {% if field_description.options.edit == 'inline' %}
+                <span id="field_actions_{{ field_element.vars.id }}" >
+                    <a
+                        href="{{ field_description.associationadmin.generateUrl('create') }}"
+                        onclick="start_field_retrieve_{{ field_element.vars.id }}(event)"
+                        class="sonata-ba-action"
+                        style="{% if not field_description.associationadmin.isGranted('CREATE')%}display:none{% endif %}"
+                        >
+                        <img
+                            src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"
+                            alt="{% trans from 'SonataAdminBundle' %}btn_add{% endtrans %}"
+                         />
+                    </a>
+                </span>
+
+                {# add code for the sortable options #}
+                {% if field_description.options.sortable is defined %}
+                    <script>
+                        jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody').sortable({
+                            axis: 'y',
+                            opacity: 0.6,
+                            items: 'tr',
+                            stop: apply_position_value_{{ field_element.vars.id }}
                         });
 
-                        jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ field_element.vars.id }}-position input').each(function(index, value) {
-                            jQuery(value).val(index + 1);
+                        function apply_position_value_{{ field_element.vars.id }}() {
+                            // update the input value position
+                            jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ field_element.vars.id }}-position').each(function(index, element) {
+                                // remove the sortable handler and put it back
+                                jQuery('span.sonata-ba-sortable-handler', element).remove();
+                                jQuery(element).append('<span class="sonata-ba-sortable-handler ui-icon ui-icon-grip-solid-horizontal"></span>');
+                                jQuery('input', element).hide();
+                            });
+
+                            jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody td.sonata-ba-td-{{ field_element.vars.id }}-position input').each(function(index, value) {
+                                jQuery(value).val(index + 1);
+                            });
+                        }
+
+                        // refresh the sortable option when a new element is added
+                        jQuery('#sonata-ba-field-container-{{ field_element.vars.id }}').bind('sonata.add_element', function() {
+                            apply_position_value_{{ field_element.vars.id }}();
+                            jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody').sortable('refresh');
                         });
-                    }
 
-                    // refresh the sortable option when a new element is added
-                    jQuery('#sonata-ba-field-container-{{ field_element.vars.id }}').bind('sonata.add_element', function() {
                         apply_position_value_{{ field_element.vars.id }}();
-                        jQuery('div#field_container_{{ field_element.vars.id }} tbody.sonata-ba-tbody').sortable('refresh');
-                    });
-
-                    apply_position_value_{{ field_element.vars.id }}();
 
-                </script>
-            {% endif %}
-
-            {# include association code #}
-            {% include 'SonataAdminBundle:CRUD:edit_orm_one_association_script.html.twig' %}
-
-        {% else %}
-            <span id="field_actions_{{ field_element.vars.id }}" >
-                <a
-                    href="{{ field_description.associationadmin.generateUrl('create') }}"
-                    onclick="start_field_dialog_form_add_{{ field_element.vars.id }}(event)"
-                    class="sonata-ba-action"
-                    style="{% if not field_description.associationadmin.isGranted('CREATE')%}display:none{% endif %}"
-                    >
-                    <img
-                        src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"
-                        alt="{% trans from 'SonataAdminBundle' %}btn_add{% endtrans %}"
-                     />
-                </a>
-            </span>
-
-            <div style="display: none" id="field_dialog_{{ field_element.vars.id }}">
+                    </script>
+                {% endif %}
 
-            </div>
+                {# include association code #}
+                {% include 'SonataAdminBundle:CRUD:edit_orm_one_association_script.html.twig' %}
 
-            {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
-        {% endif %}
-    </div>
+            {% else %}
+                <span id="field_actions_{{ field_element.vars.id }}" >
+                    <a
+                        href="{{ field_description.associationadmin.generateUrl('create') }}"
+                        onclick="start_field_dialog_form_add_{{ field_element.vars.id }}(event)"
+                        class="sonata-ba-action"
+                        style="{% if not field_description.associationadmin.isGranted('CREATE')%}display:none{% endif %}"
+                        >
+                        <img
+                            src="{{ asset('bundles/sonataadmin/famfamfam/add.png') }}"
+                            alt="{% trans from 'SonataAdminBundle' %}btn_add{% endtrans %}"
+                         />
+                    </a>
+                </span>
+
+                <div style="display: none" id="field_dialog_{{ field_element.vars.id }}">
+
+                </div>
+
+                {% include 'SonataAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %}
+            {% endif %}
+        </div>
+    {% endif %}
 {% endblock %}

+ 3 - 1
Resources/views/CRUD/edit_orm_one_to_one.html.twig

@@ -12,7 +12,9 @@ file that was distributed with this source code.
 {% extends base_template %}
 
 {% block field %}
-    {% if field_description.options.edit == 'inline' %}
+    {% if not field_description.hasassociationadmin%}
+        {# TODO : add some logic here #}
+    {% elseif field_description.options.edit == 'inline' %}
         {% for nested_field_description in field_description.associationadmin.formfielddescriptions %}
             {{ nested_field_description|render_form_element(field_element, value) }}
         {% endfor %}

+ 5 - 0
Resources/views/CRUD/list_orm_many_to_many.html.twig

@@ -9,3 +9,8 @@ file that was distributed with this source code.
 
 #}
 
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
+
+{% block field%}
+
+{% endblock %}

+ 1 - 1
Resources/views/CRUD/list_orm_many_to_one.html.twig

@@ -13,7 +13,7 @@ file that was distributed with this source code.
 
 {% block field%}
     {% if value %}
-        {% if field_description.associationadmin.isGranted('EDIT')%}
+        {% if field_description.hasAssociationAdmin and field_description.associationadmin.isGranted('EDIT')%}
             <a href="{{ field_description.associationadmin.generateUrl('edit', {'id': value.id}) }}">{{ value }}</a>
         {% else %}
             {{ value }}

+ 6 - 0
Resources/views/CRUD/list_orm_one_to_many.html.twig

@@ -8,3 +8,9 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
+
+{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
+
+{% block field%}
+
+{% endblock %}

+ 1 - 1
Resources/views/CRUD/list_orm_one_to_one.html.twig

@@ -14,7 +14,7 @@ file that was distributed with this source code.
 {% block field%}
 
     {% if value.id %}
-        {% if field_description.associationadmin.isGranted('EDIT')%}
+        {% if field_description.hasAssociationAdmin and field_description.associationadmin.isGranted('EDIT')%}
             <a href="{{ field_description.associationadmin.generateUrl('edit', {'id': value.id}) }}">{{ value }}</a>
         {% else %}
             {{ value }}

+ 2 - 3
Security/Handler/AclSecurityHandler.php

@@ -9,7 +9,6 @@
  * file that was distributed with this source code.
  */
 
-
 namespace Sonata\AdminBundle\Security\Handler;
 
 use Symfony\Component\Security\Core\SecurityContextInterface;
@@ -25,7 +24,7 @@ class AclSecurityHandler implements SecurityHandlerInterface
     /**
      * {@inheritDoc}
      */
-    function isGranted($attributes, $object = null)
+    public function isGranted($attributes, $object = null)
     {
         return $this->securityContext->isGranted($attributes, $this);
     }
@@ -33,7 +32,7 @@ class AclSecurityHandler implements SecurityHandlerInterface
     /**
      * {@inheritDoc}
      */
-    function buildSecurityInformation(AdminInterface $admin)
+    public function buildSecurityInformation(AdminInterface $admin)
     {
         $baseRole = 'ROLE_'.str_replace('.', '_', strtoupper($admin->getCode())).'_%s';
 

+ 2 - 4
Security/Handler/NoopSecurityHandler.php

@@ -9,18 +9,16 @@
  * file that was distributed with this source code.
  */
 
-
 namespace Sonata\AdminBundle\Security\Handler;
 
 use Sonata\AdminBundle\Admin\AdminInterface;
 
 class NoopSecurityHandler implements SecurityHandlerInterface
 {
-
     /**
      * {@inheritDoc}
      */
-    function isGranted($attributes, $object = null)
+    public function isGranted($attributes, $object = null)
     {
         return true;
     }
@@ -28,7 +26,7 @@ class NoopSecurityHandler implements SecurityHandlerInterface
     /**
      * {@inheritDoc}
      */
-    function buildSecurityInformation(AdminInterface $admin)
+    public function buildSecurityInformation(AdminInterface $admin)
     {
         return array();
     }

+ 0 - 1
Security/Handler/SecurityHandlerInterface.php

@@ -9,7 +9,6 @@
  * file that was distributed with this source code.
  */
 
-
 namespace Sonata\AdminBundle\Security\Handler;
 
 use Sonata\AdminBundle\Admin\AdminInterface;

+ 1 - 0
Tests/Security/Acl/Permission/MaskBuilderTest.php

@@ -8,6 +8,7 @@
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
  */
+
 namespace Sonata\AdminBundle\Tests\Admin\Security\Acl\Permission;
 
 use Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder;

+ 0 - 1
Tests/Security/Handler/AclSecurityHandlerTest.php

@@ -16,7 +16,6 @@ class AclSecurityHandlerTest extends \PHPUnit_Framework_TestCase
 {
     public function testAcl()
     {
-
         $securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
         $securityContext->expects($this->any())
             ->method('isGranted')

+ 0 - 1
Tests/Security/Handler/NoopSecurityHandlerTest.php

@@ -16,7 +16,6 @@ class NoopSecurityHandlerTest extends \PHPUnit_Framework_TestCase
 {
     public function testNoop()
     {
-
         $handler = new NoopSecurityHandler;
 
         $this->assertTrue($handler->isGranted(array('TOTO')));

+ 1 - 1
Twig/Extension/SonataAdminExtension.php

@@ -158,7 +158,7 @@ class SonataAdminExtension extends \Twig_Extension
         }
 
         if (!$formView->offsetExists($fieldDescription->getFieldName())) {
-            throw new \RuntimeException(sprintf('No child named %s', $fieldDescription->getFieldName()));
+            return;
         }
 
         $children = $formView->offsetGet($fieldDescription->getFieldName());