function GroupwiseMax::conditionNamespace

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php \Drupal\views\Plugin\views\relationship\GroupwiseMax::conditionNamespace()
  2. 10 core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php \Drupal\views\Plugin\views\relationship\GroupwiseMax::conditionNamespace()
  3. 11.x core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php \Drupal\views\Plugin\views\relationship\GroupwiseMax::conditionNamespace()

Helper function to namespace query pieces.

Turns 'foo.bar' into '"foo_NAMESPACE".bar'. PostgreSQL doesn't support mixed-cased identifiers unless quoted, so we need to quote each single part to prevent from query exceptions.

2 calls to GroupwiseMax::conditionNamespace()
GroupwiseMax::alterSubqueryCondition in core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
Recursive helper to add a namespace to conditions.
GroupwiseMax::leftQuery in core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
Generate a subquery given the user options, as set in the options.

File

core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php, line 324

Class

GroupwiseMax
Relationship handler that allows a groupwise maximum of the linked in table. For a definition, see: http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row… In lay terms, instead of joining to get all matching records in the…

Namespace

Drupal\views\Plugin\views\relationship

Code

protected function conditionNamespace($string) {
    $parts = explode(' = ', $string);
    foreach ($parts as &$part) {
        if (strpos($part, '.') !== FALSE) {
            $part = '"' . str_replace('.', $this->subquery_namespace . '".', $part);
        }
    }
    return implode(' = ', $parts);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.