entity_translation_handler_filter_language.inc 645 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Contains a language filter handler.
  5. */
  6. /**
  7. * Extends the locale language filter in order for it to work with the entity
  8. * translation table structure.
  9. */
  10. class entity_translation_handler_filter_language extends views_handler_filter_locale_language {
  11. /**
  12. * Override the default behaviour, insert an empty string instead of NULL.
  13. */
  14. function op_empty() {
  15. $this->ensure_my_table();
  16. if ($this->operator == 'empty') {
  17. $operator = "=";
  18. }
  19. else {
  20. $operator = "<>";
  21. }
  22. $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", '', $operator);
  23. }
  24. }