print_join_page_counter.inc 972 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Custom Views integration join for the page counters.
  5. *
  6. * @ingroup print
  7. */
  8. /**
  9. * Class print_join_page_counter.
  10. */
  11. class print_join_page_counter extends views_join {
  12. /**
  13. * @inheritdoc
  14. */
  15. public function construct($table = NULL, $left_table = NULL, $left_field = NULL, $field = NULL, $extra = array(), $type = 'LEFT') {
  16. // PHP 4 doesn't call constructors of the base class automatically from a
  17. // constructor of a derived class. It is your responsibility to propagate
  18. // the call to constructors upstream where appropriate.
  19. parent::construct($table, $left_table, $left_field, $field, $extra, $type);
  20. }
  21. /**
  22. * @inheritdoc
  23. */
  24. public function build_join($select_query, $table, $view_query) {
  25. if ($this->left_table) {
  26. $this->left_field = "CONCAT('node/', $this->left_table.$this->left_field)";
  27. $this->left_table = NULL;
  28. }
  29. parent::build_join($select_query, $table, $view_query);
  30. }
  31. }