AdminTreeInterface.php 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. /**
  12. * @author Jules Lamur <contact@juleslamur.fr>
  13. */
  14. interface AdminTreeInterface
  15. {
  16. /**
  17. * Returns the root ancestor or itself if not a child.
  18. *
  19. * @return AdminInterface
  20. */
  21. public function getRootAncestor();
  22. /**
  23. * Returns the depth of the admin.
  24. * e.g. 0 if not a child; 2 if child of a child; etc...
  25. *
  26. * @return int
  27. */
  28. public function getChildDepth();
  29. /**
  30. * Returns the current leaf child admin instance,
  31. * or null if there's no current child.
  32. *
  33. * @return AdminInterface|null
  34. */
  35. public function getCurrentLeafChildAdmin();
  36. }