DatagridInterface.php 1.8 KB

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