original_string: protected function _getActionGroups()
      {
          $action = $this->_action();
          $groups = $action->getConfig('scaffold.action_groups') ?: [];
  
          $groupedActions = [];
          foreach ($groups as $group) {
              $groupedActions[] = array_keys(Hash::normalize($group));
          }
  
          // add "primary" actions (primary should rendered as separate buttons)
          $groupedActions = (new Collection($groupedActions))->unfold()->toList();
          $groups['primary'] = array_diff(array_keys($this->_getAllowedActions()), $groupedActions);
  
          return $groups;
      }
code: protected function _getActionGroups()
      {
          $action = $this->_action();
          $groups = $action->getConfig('scaffold.action_groups') ?: [];
  
          $groupedActions = [];
          foreach ($groups as $group) {
              $groupedActions[] = array_keys(Hash::normalize($group));
          }
  
          // add "primary" actions (primary should rendered as separate buttons)
          $groupedActions = (new Collection($groupedActions))->unfold()->toList();
          $groups['primary'] = array_diff(array_keys($this->_getAllowedActions()), $groupedActions);
  
          return $groups;
      }
code_tokens: protected function _getActionGroups ( ) { $ action = $ this -> _action ( ) ; $ groups = $ action -> getConfig ( 'scaffold.action_groups' ) ? : [ ] ; $ groupedActions = [ ] ; foreach ( $ groups as $ group ) { $ groupedActions [ ] = array_keys ( Hash :: normalize ( $ group ) ) ; } // add "primary" actions (primary should rendered as separate buttons) $ groupedActions = ( new Collection ( $ groupedActions ) ) -> unfold ( ) -> toList ( ) ; $ groups [ 'primary' ] = array_diff ( array_keys ( $ this -> _getAllowedActions ( ) ) , $ groupedActions ) ; return $ groups ; }
docstring: Get action groups
  
  @return array
docstring_tokens: Get action groups