src/Zicht/Bundle/AdminBundle/Util/AdminUtil.php
public static function reorderTabs(FormMapper $formMapper, array $tabOrder)
    {
        $tabsOriginal = $formMapper->getAdmin()->getFormTabs();

        //filter out tabs that doesn't exist (yet)
        $tabOrder = array_filter(
            $tabOrder,
            function ($key) use ($tabsOriginal) {
                return array_key_exists($key, $tabsOriginal);
            }
        );

        $tabs = array_merge(array_flip($tabOrder), $tabsOriginal);
        $formMapper->getAdmin()->setFormTabs($tabs);
    }
public static function reorderTabs(FormMapper $formMapper, array $tabOrder)
    {
        $tabsOriginal = $formMapper->getAdmin()->getFormTabs();

        //filter out tabs that doesn't exist (yet)
        $tabOrder = array_filter(
            $tabOrder,
            function ($key) use ($tabsOriginal) {
                return array_key_exists($key, $tabsOriginal);
            }
        );

        $tabs = array_merge(array_flip($tabOrder), $tabsOriginal);
        $formMapper->getAdmin()->setFormTabs($tabs);
    }
public static function reorderTabs ( FormMapper $ formMapper , array $ tabOrder ) { $ tabsOriginal = $ formMapper -> getAdmin ( ) -> getFormTabs ( ) ; //filter out tabs that doesn't exist (yet) $ tabOrder = array_filter ( $ tabOrder , function ( $ key ) use ( $ tabsOriginal ) { return array_key_exists ( $ key , $ tabsOriginal ) ; } ) ; $ tabs = array_merge ( array_flip ( $ tabOrder ) , $ tabsOriginal ) ; $ formMapper -> getAdmin ( ) -> setFormTabs ( $ tabs ) ; }
Allows to reorder Tabs

Need the formMapper since the used methods to set the tabs
are protected in the original Sonata implementation

@param FormMapper $formMapper
@param array $tabOrder

@return void
Allows to reorder Tabs