瀏覽代碼

Rename configureShowField to configureShowFields to match the documentation

Alain Diart 13 年之前
父節點
當前提交
0f68a3e0e7
共有 2 個文件被更改,包括 14 次插入3 次删除
  1. 13 2
      Admin/Admin.php
  2. 1 1
      Admin/AdminExtensionInterface.php

+ 13 - 2
Admin/Admin.php

@@ -68,7 +68,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     private $show;
 
     /**
-     * The show FieldDescription constructed from the configureShowField method
+     * The show FieldDescription constructed from the configureShowFields method
      *
      * @var array
      */
@@ -395,6 +395,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     }
 
     /**
+     * @deprecated Use configureShowFields instead.
      * @param \Sonata\AdminBundle\Show\ShowMapper $filter
      * @return void
      */
@@ -403,6 +404,15 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
 
     }
 
+    /**
+     * @param \Sonata\AdminBundle\Show\ShowMapper $filter
+     * @return void
+     */
+    protected function configureShowFields(ShowMapper $filter)
+    {
+
+    }
+
     /**
      * configure the Admin routes
      *
@@ -550,7 +560,8 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         $collection = new FieldDescriptionCollection();
         $mapper = new ShowMapper($this->showBuilder, $collection, $this);
 
-        $this->configureShowField($mapper);
+        $this->configureShowField($mapper); // deprecated, use configureShowFields instead
+        $this->configureShowFields($mapper);
 
         $this->show = $collection;
     }

+ 1 - 1
Admin/AdminExtensionInterface.php

@@ -48,7 +48,7 @@ interface AdminExtensionInterface
      * @param \Sonata\AdminBundle\Show\ShowMapper $filter
      * @return void
      */
-    function configureShowField(ShowMapper $filter);
+    function configureShowFields(ShowMapper $filter);
 
     /**
      * @abstract