protected function configureRoutes(RouteCollection $collection)
    {
        parent::configureRoutes($collection);
        $collection->add('duplicate', $this->getRouterIdParameter() . '/duplicate');
        $collection->add('generateEntityCode');

        /* Needed or not needed ...
         * in sonata-project/admin-bundle/Controller/CRUDController.php
         * the batchAction method
         * throw exception if the http method is not POST
        */
        if ($collection->get('batch')) {
            $collection->get('batch')->setMethods(['POST']);
        }
    }