浏览代码

Enable overriding of the default admin class for model properties.

Romain Geissler 13 年之前
父节点
当前提交
259cbbf21d
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      Admin/Admin.php

+ 8 - 1
Admin/Admin.php

@@ -1106,7 +1106,14 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     {
     {
         $pool = $this->getConfigurationPool();
         $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) {
         if (!$admin) {
             return;
             return;
         }
         }