DatagridInterface.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. /**
  34. */
  35. public function buildPager();
  36. /**
  37. * @param FilterInterface $filter
  38. *
  39. * @return FilterInterface
  40. */
  41. public function addFilter(FilterInterface $filter);
  42. /**
  43. * @return array
  44. */
  45. public function getFilters();
  46. /**
  47. * Reorder filters.
  48. *
  49. * @param array $keys
  50. */
  51. public function reorderFilters(array $keys);
  52. /**
  53. * @return array
  54. */
  55. public function getValues();
  56. /**
  57. * @return FieldDescriptionCollection
  58. */
  59. public function getColumns();
  60. /**
  61. * @param string $name
  62. * @param string $operator
  63. * @param mixed $value
  64. */
  65. public function setValue($name, $operator, $value);
  66. /**
  67. * @return FormInterface
  68. */
  69. public function getForm();
  70. /**
  71. * @param string $name
  72. *
  73. * @return FilterInterface
  74. */
  75. public function getFilter($name);
  76. /**
  77. * @param string $name
  78. *
  79. * @return bool
  80. */
  81. public function hasFilter($name);
  82. /**
  83. * @param string $name
  84. */
  85. public function removeFilter($name);
  86. /**
  87. * @return bool
  88. */
  89. public function hasActiveFilters();
  90. /**
  91. * @return bool
  92. */
  93. public function hasDisplayableFilters();
  94. }