FilterInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. * @abstract
  32. * @return array
  33. */
  34. function getDefaultOptions();
  35. /**
  36. * @abstract
  37. * @param string $name
  38. * @param null $default
  39. * @return void
  40. */
  41. function getOption($name, $default = null);
  42. /**
  43. * @abstract
  44. * @param $name
  45. * @param array $options
  46. * @return void
  47. */
  48. function initialize($name, array $options = array());
  49. /**
  50. * @abstract
  51. * @return void
  52. */
  53. function getFieldName();
  54. /**
  55. * @abstract
  56. * @return void
  57. */
  58. function getFieldOptions();
  59. /**
  60. * @abstract
  61. * @return void
  62. */
  63. function getFieldType();
  64. }