DatagridInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /*
  3. * This file is part of the Sonata 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. */
  11. namespace Sonata\AdminBundle\Datagrid;
  12. use Sonata\AdminBundle\Filter\FilterInterface;
  13. interface DatagridInterface
  14. {
  15. /**
  16. * @return \Sonata\AdminBundle\Datagrid\PagerInterface
  17. */
  18. function getPager();
  19. /**
  20. * @return \Sonata\AdminBundle\Datagrid\ProxyQueryInterface
  21. */
  22. function getQuery();
  23. /**
  24. * @return array
  25. */
  26. function getResults();
  27. /**
  28. * @return void
  29. */
  30. function buildPager();
  31. /**
  32. * @param \Sonata\AdminBundle\Filter\FilterInterface $filter
  33. *
  34. * @return \Sonata\AdminBundle\Filter\FilterInterface
  35. */
  36. function addFilter(FilterInterface $filter);
  37. /**
  38. * @return array
  39. */
  40. function getFilters();
  41. /**
  42. * @return array
  43. */
  44. function getValues();
  45. /**
  46. * @return array
  47. */
  48. function getColumns();
  49. /**
  50. * @param string $name
  51. * @param string $operator
  52. * @param mixed $value
  53. */
  54. function setValue($name, $operator, $value);
  55. /**
  56. * @return \Symfony\Component\Form\Form
  57. */
  58. function getForm();
  59. /**
  60. * @param string $name
  61. *
  62. * @return \Sonata\AdminBundle\Filter\FilterInterface
  63. */
  64. function getFilter($name);
  65. /**
  66. * @param string $name
  67. *
  68. * @return bool
  69. */
  70. function hasFilter($name);
  71. /**
  72. * @param string $name
  73. */
  74. function removeFilter($name);
  75. /**
  76. * @return boolean
  77. */
  78. public function hasActiveFilters();
  79. }