protected function getBundleName()
    {
        $pattern = "/(.*)Bundle/";
        $matches = array();
        preg_match($pattern, $this->getRequest()->get('_controller'), $matches);
        return empty($matches) ? null : $matches[1];
    }