Procházet zdrojové kódy

Enable overriding of the default admin class for model properties.

Romain Geissler před 13 roky
rodič
revize
259cbbf21d
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  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;
         }