DatagridInterface.php 2.1 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\Filter\FilterInterface;
  12. /**
  13. * Interface DatagridInterface.
  14. *
  15. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  16. */
  17. interface DatagridInterface
  18. {
  19. /**
  20. * @return \Sonata\AdminBundle\Datagrid\PagerInterface
  21. */
  22. public function getPager();
  23. /**
  24. * @return \Sonata\AdminBundle\Datagrid\ProxyQueryInterface
  25. */
  26. public function getQuery();
  27. /**
  28. * @return array
  29. */
  30. public function getResults();
  31. /**
  32. */
  33. public function buildPager();
  34. /**
  35. * @param \Sonata\AdminBundle\Filter\FilterInterface $filter
  36. *
  37. * @return \Sonata\AdminBundle\Filter\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 \Sonata\AdminBundle\Admin\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 \Symfony\Component\Form\Form
  66. */
  67. public function getForm();
  68. /**
  69. * @param string $name
  70. *
  71. * @return \Sonata\AdminBundle\Filter\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. }