瀏覽代碼

Merge remote-tracking branch 'willdurant/master'

Thomas Rabaix 14 年之前
父節點
當前提交
2060ed489f
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Admin/Admin.php

+ 3 - 3
Admin/Admin.php

@@ -547,7 +547,7 @@ abstract class Admin implements AdminInterface
     public function getBaseRoutePattern()
     {
         if (!$this->baseRoutePattern) {
-            preg_match('@([A-Za-z]*)\\\([A-Za-z]*)Bundle\\\(Entity|Document)\\\(.*)@', $this->getClass(), $matches);
+            preg_match('@([A-Za-z0-9]*)\\\([A-Za-z0-9]*)Bundle\\\(Entity|Document|Model)\\\(.*)@', $this->getClass(), $matches);
 
             if (!$matches) {
                 throw new \RuntimeException(sprintf('Please define a default `baseRoutePattern` value for the admin class `%s`', get_class($this)));
@@ -580,7 +580,7 @@ abstract class Admin implements AdminInterface
     public function getBaseRouteName()
     {
         if (!$this->baseRouteName) {
-            preg_match('@([A-Za-z]*)\\\([A-Za-z]*)Bundle\\\(Entity|Document)\\\(.*)@', $this->getClass(), $matches);
+            preg_match('@([A-Za-z0-9]*)\\\([A-Za-z0-9]*)Bundle\\\(Entity|Document|Model)\\\(.*)@', $this->getClass(), $matches);
 
             if (!$matches) {
                 throw new \RuntimeException(sprintf('Please define a default `baseRouteName` value for the admin class `%s`', get_class($this)));
@@ -1784,4 +1784,4 @@ abstract class Admin implements AdminInterface
     {
         $this->modelManager = $modelManager;
     }
-}
+}