StatusClassRendererInterface.php 913 B

123456789101112131415161718192021222324252627282930313233343536373839
  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\CoreBundle\Component\Status;
  11. /**
  12. * @author Hugo Briand <briand@ekino.com>
  13. */
  14. interface StatusClassRendererInterface
  15. {
  16. /**
  17. * Tells if class may handle $object for status class rendering.
  18. *
  19. * @param mixed $object
  20. * @param null $statusName
  21. *
  22. * @return bool
  23. */
  24. public function handlesObject($object, $statusName = null);
  25. /**
  26. * Returns the status CSS class for $object.
  27. *
  28. * @param mixed $object
  29. * @param null $statusName
  30. * @param string $default
  31. *
  32. * @return string
  33. */
  34. public function getStatusClass($object, $statusName = null, $default = '');
  35. }