MenuBuilderInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\AdminBundle\Admin;
  11. use Knp\Menu\ItemInterface;
  12. /**
  13. * This interface can be implemented by admins that need to build menus.
  14. *
  15. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  16. */
  17. interface MenuBuilderInterface
  18. {
  19. /**
  20. * NEXT_MAJOR: remove this method.
  21. *
  22. * @param string $action
  23. * @param AdminInterface $childAdmin
  24. *
  25. * @return ItemInterface|bool
  26. *
  27. * @deprecated Use buildTabMenu instead
  28. */
  29. public function buildSideMenu($action, AdminInterface $childAdmin = null);
  30. /**
  31. * Build the tab menu related to the current action.
  32. *
  33. * @param string $action
  34. * @param AdminInterface $childAdmin
  35. *
  36. * @return ItemInterface|bool
  37. */
  38. public function buildTabMenu($action, AdminInterface $childAdmin = null);
  39. }