UserProfileBreadcrumbBlockService.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /**
  13. * Class for user breadcrumbs.
  14. *
  15. * @author Sylvain Deloux <sylvain.deloux@ekino.com>
  16. */
  17. class UserProfileBreadcrumbBlockService extends BaseUserProfileBreadcrumbBlockService
  18. {
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function getName()
  23. {
  24. return 'sonata.user.block.breadcrumb_profile';
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. protected function getMenu(BlockContextInterface $blockContext)
  30. {
  31. $menu = $this->getRootMenu($blockContext);
  32. $menu->addChild('sonata_user_profile_breadcrumb_edit', array(
  33. 'route' => 'sonata_user_profile_edit',
  34. 'extras' => array('translation_domain' => 'SonataUserBundle'),
  35. ));
  36. return $menu;
  37. }
  38. }