BaseUserProfileBreadcrumbBlockService.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\UserBundle\Block\Breadcrumb;
  11. use Sonata\BlockBundle\Block\BlockContextInterface;
  12. use Sonata\SeoBundle\Block\Breadcrumb\BaseBreadcrumbMenuBlockService;
  13. /**
  14. * Abstract class for user breadcrumbs.
  15. *
  16. * @author Sylvain Deloux <sylvain.deloux@ekino.com>
  17. */
  18. abstract class BaseUserProfileBreadcrumbBlockService extends BaseBreadcrumbMenuBlockService
  19. {
  20. /**
  21. * {@inheritdoc}
  22. */
  23. protected function getRootMenu(BlockContextInterface $blockContext)
  24. {
  25. $menu = parent::getRootMenu($blockContext);
  26. $menu->addChild('sonata_user_profile_breadcrumb_index', array(
  27. 'route' => 'sonata_user_profile_show',
  28. 'extras' => array('translation_domain' => 'SonataUserBundle'),
  29. ));
  30. return $menu;
  31. }
  32. }