浏览代码

Added comments to warn about the discussion in sonata-project/SonataAdminBundle#1351

ddebree 12 年之前
父节点
当前提交
05ef01c96b
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Mapper/BaseGroupedMapper.php

+ 5 - 0
Mapper/BaseGroupedMapper.php

@@ -67,6 +67,8 @@ abstract class BaseGroupedMapper extends BaseMapper
      */
      */
     protected function addFieldToCurrentGroup($fieldName) 
     protected function addFieldToCurrentGroup($fieldName) 
     {
     {
+        //Note this line must happen before the next line. 
+        //See https://github.com/sonata-project/SonataAdminBundle/pull/1351
         $currentGroup = $this->getCurrentGroupName();
         $currentGroup = $this->getCurrentGroupName();
         $groups = $this->getGroups();
         $groups = $this->getGroups();
         $groups[$currentGroup]['fields'][$fieldName] = $fieldName;
         $groups[$currentGroup]['fields'][$fieldName] = $fieldName;
@@ -77,6 +79,9 @@ abstract class BaseGroupedMapper extends BaseMapper
      * Return the name of the currently selected group. The method also makes 
      * Return the name of the currently selected group. The method also makes 
      * sure a valid group name is currently selected
      * sure a valid group name is currently selected
      * 
      * 
+     * Note that this can have the side effect to change the "group" value
+     * returned by the getGroup function
+     * 
      * @return string
      * @return string
      */
      */
     protected function getCurrentGroupName() 
     protected function getCurrentGroupName()