DatagridInterface.php 2.0 KB

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