FilterInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. namespace Sonata\AdminBundle\Filter;
  11. interface FilterInterface
  12. {
  13. /**
  14. * Apply the filter to the QueryBuilder instance
  15. *
  16. * @abstract
  17. * @param $queryBuilder
  18. * @param string $alias
  19. * @param string $field
  20. * @param string $value
  21. * @return void
  22. */
  23. function filter($queryBuilder, $alias, $field, $value);
  24. /**
  25. * Returns the filter name
  26. * @abstract
  27. * @return string
  28. */
  29. function getName();
  30. /**
  31. * Returns the label name
  32. *
  33. * @abstract
  34. * @return void
  35. */
  36. function getLabel();
  37. /**
  38. * @abstract
  39. * @return array
  40. */
  41. function getDefaultOptions();
  42. /**
  43. * @abstract
  44. * @param string $name
  45. * @param null $default
  46. * @return void
  47. */
  48. function getOption($name, $default = null);
  49. /**
  50. * @abstract
  51. * @param $name
  52. * @param array $options
  53. * @return void
  54. */
  55. function initialize($name, array $options = array());
  56. /**
  57. * @abstract
  58. * @return void
  59. */
  60. function getFieldName();
  61. /**
  62. * @abstract
  63. * @return void
  64. */
  65. function getFieldOptions();
  66. /**
  67. * @abstract
  68. * @return void
  69. */
  70. function getFieldType();
  71. /**
  72. * Returns the main widget used to render the filter
  73. *
  74. * @abstract
  75. * @return void
  76. */
  77. function getRenderSettings();
  78. }