Explorar el Código

Enable overriding of the default admin class for model properties.

Romain Geissler hace 13 años
padre
commit
259cbbf21d
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      Admin/Admin.php

+ 8 - 1
Admin/Admin.php

@@ -1106,7 +1106,14 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     {
         $pool = $this->getConfigurationPool();
 
-        $admin = $pool->getAdminByClass($fieldDescription->getTargetEntity());
+        $adminCode = $fieldDescription->getOption('admin_code');
+
+        if ($adminCode !== null) {
+            $admin = $pool->getAdminByAdminCode($adminCode);
+        } else {
+            $admin = $pool->getAdminByClass($fieldDescription->getTargetEntity());
+        }
+
         if (!$admin) {
             return;
         }