MenuBuilderInterface.php 1.3 KB

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