protected function applyActionsBuilderDefaults(array $params)
    {
        if (!array_key_exists('namespace_prefix', $params) || !array_key_exists('bundle_name', $params)) {
            return $params;
        }

        $routeBase = $params['namespace_prefix'].'_'.$params['bundle_name'].'_'.$this->getBaseGeneratorName();

        if (array_key_exists('object_actions', $params) && is_array($params['object_actions'])) {
            foreach ($params['object_actions'] as $name => $config) {
                $baseKey = 'object_actions.'.$name;

                if (is_array($config) && array_key_exists('route', $config) && $config['route'] === 'inject_object_defaults') {
                    $customized = $params['object_actions'][$name];
                    unset($customized['route']);

                    $params['object_actions'][$name] = $this->recursiveReplace(array(
                        'route'         => $routeBase.'_object',
                        'label'         => $baseKey.'.label',
                        'csrfProtected' => true,
                        'params'        => array(
                            'pk'        => '{{ '.$this->getBaseGeneratorName().'.id }}',
                            'action'    => $name,
                        ),
                        'options'       => array(
                            'title'     => $baseKey.'.title',
                            'success'   => $baseKey.'.success',
                            'error'     => $baseKey.'.error',
                        ),
                    ), $customized);
                }
            }
        }

        if (array_key_exists('batch_actions', $params) && is_array($params['batch_actions'])) {
            foreach ($params['batch_actions'] as $name => $config) {
                $baseKey = 'batch_actions.'.$name;

                if (is_array($config) && array_key_exists('route', $config) && $config['route'] === 'inject_batch_defaults') {
                    $params['batch_actions'][$name] = $this->recursiveReplace($params['batch_actions'][$name], array(
                        'route'         => $routeBase.'_batch',
                        'label'         => $baseKey.'.label',
                        'csrfProtected' => true,
                        'params'        => array(
                            'action'    => $name,
                        ),
                        'options'       => array(
                            'title'     => $baseKey.'.title',
                            'success'   => $baseKey.'.success',
                            'error'     => $baseKey.'.error',
                            'notfound'  => $baseKey.'.notfound',
                        ),
                    ));
                }
            }
        }

        return $params;
    }
protected function applyActionsBuilderDefaults(array $params)
    {
        if (!array_key_exists('namespace_prefix', $params) || !array_key_exists('bundle_name', $params)) {
            return $params;
        }

        $routeBase = $params['namespace_prefix'].'_'.$params['bundle_name'].'_'.$this->getBaseGeneratorName();

        if (array_key_exists('object_actions', $params) && is_array($params['object_actions'])) {
            foreach ($params['object_actions'] as $name => $config) {
                $baseKey = 'object_actions.'.$name;

                if (is_array($config) && array_key_exists('route', $config) && $config['route'] === 'inject_object_defaults') {
                    $customized = $params['object_actions'][$name];
                    unset($customized['route']);

                    $params['object_actions'][$name] = $this->recursiveReplace(array(
                        'route'         => $routeBase.'_object',
                        'label'         => $baseKey.'.label',
                        'csrfProtected' => true,
                        'params'        => array(
                            'pk'        => '{{ '.$this->getBaseGeneratorName().'.id }}',
                            'action'    => $name,
                        ),
                        'options'       => array(
                            'title'     => $baseKey.'.title',
                            'success'   => $baseKey.'.success',
                            'error'     => $baseKey.'.error',
                        ),
                    ), $customized);
                }
            }
        }

        if (array_key_exists('batch_actions', $params) && is_array($params['batch_actions'])) {
            foreach ($params['batch_actions'] as $name => $config) {
                $baseKey = 'batch_actions.'.$name;

                if (is_array($config) && array_key_exists('route', $config) && $config['route'] === 'inject_batch_defaults') {
                    $params['batch_actions'][$name] = $this->recursiveReplace($params['batch_actions'][$name], array(
                        'route'         => $routeBase.'_batch',
                        'label'         => $baseKey.'.label',
                        'csrfProtected' => true,
                        'params'        => array(
                            'action'    => $name,
                        ),
                        'options'       => array(
                            'title'     => $baseKey.'.title',
                            'success'   => $baseKey.'.success',
                            'error'     => $baseKey.'.error',
                            'notfound'  => $baseKey.'.notfound',
                        ),
                    ));
                }
            }
        }

        return $params;
    }
protected function applyActionsBuilderDefaults ( array $ params ) { if ( ! array_key_exists ( 'namespace_prefix' , $ params ) || ! array_key_exists ( 'bundle_name' , $ params ) ) { return $ params ; } $ routeBase = $ params [ 'namespace_prefix' ] . '_' . $ params [ 'bundle_name' ] . '_' . $ this -> getBaseGeneratorName ( ) ; if ( array_key_exists ( 'object_actions' , $ params ) && is_array ( $ params [ 'object_actions' ] ) ) { foreach ( $ params [ 'object_actions' ] as $ name => $ config ) { $ baseKey = 'object_actions.' . $ name ; if ( is_array ( $ config ) && array_key_exists ( 'route' , $ config ) && $ config [ 'route' ] === 'inject_object_defaults' ) { $ customized = $ params [ 'object_actions' ] [ $ name ] ; unset ( $ customized [ 'route' ] ) ; $ params [ 'object_actions' ] [ $ name ] = $ this -> recursiveReplace ( array ( 'route' => $ routeBase . '_object' , 'label' => $ baseKey . '.label' , 'csrfProtected' => true , 'params' => array ( 'pk' => '{{ ' . $ this -> getBaseGeneratorName ( ) . '.id }}' , 'action' => $ name , ) , 'options' => array ( 'title' => $ baseKey . '.title' , 'success' => $ baseKey . '.success' , 'error' => $ baseKey . '.error' , ) , ) , $ customized ) ; } } } if ( array_key_exists ( 'batch_actions' , $ params ) && is_array ( $ params [ 'batch_actions' ] ) ) { foreach ( $ params [ 'batch_actions' ] as $ name => $ config ) { $ baseKey = 'batch_actions.' . $ name ; if ( is_array ( $ config ) && array_key_exists ( 'route' , $ config ) && $ config [ 'route' ] === 'inject_batch_defaults' ) { $ params [ 'batch_actions' ] [ $ name ] = $ this -> recursiveReplace ( $ params [ 'batch_actions' ] [ $ name ] , array ( 'route' => $ routeBase . '_batch' , 'label' => $ baseKey . '.label' , 'csrfProtected' => true , 'params' => array ( 'action' => $ name , ) , 'options' => array ( 'title' => $ baseKey . '.title' , 'success' => $ baseKey . '.success' , 'error' => $ baseKey . '.error' , 'notfound' => $ baseKey . '.notfound' , ) , ) ) ; } } } return $ params ; }
Inject default batch and object actions settings

@return array
Inject default batch and object actions settings