DatagridInterface.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. /**
  27. */
  28. public function buildPager();
  29. /**
  30. * @param \Sonata\AdminBundle\Filter\FilterInterface $filter
  31. *
  32. * @return \Sonata\AdminBundle\Filter\FilterInterface
  33. */
  34. public function addFilter(FilterInterface $filter);
  35. /**
  36. * @return array
  37. */
  38. public function getFilters();
  39. /**
  40. * Reorder filters.
  41. */
  42. public function reorderFilters(array $keys);
  43. /**
  44. * @return array
  45. */
  46. public function getValues();
  47. /**
  48. * @return array
  49. */
  50. public function getColumns();
  51. /**
  52. * @param string $name
  53. * @param string $operator
  54. * @param mixed $value
  55. */
  56. public function setValue($name, $operator, $value);
  57. /**
  58. * @return \Symfony\Component\Form\Form
  59. */
  60. public function getForm();
  61. /**
  62. * @param string $name
  63. *
  64. * @return \Sonata\AdminBundle\Filter\FilterInterface
  65. */
  66. public function getFilter($name);
  67. /**
  68. * @param string $name
  69. *
  70. * @return bool
  71. */
  72. public function hasFilter($name);
  73. /**
  74. * @param string $name
  75. */
  76. public function removeFilter($name);
  77. /**
  78. * @return bool
  79. */
  80. public function hasActiveFilters();
  81. }