DatagridInterface.php 2.0 KB

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