DatagridInterface.php 2.0 KB

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