public function shouldJoin($key, $prefix = null)
    {
        $parts = explode('.', $key);

        if (!$prefix) {
            $prefix = $this->getRootAlias();
        }

        if (!in_array($parts[0], $this->qb->getAllAliases())) {
            $this->qb->leftJoin($prefix.'.'.$parts[0], $parts[0]);
        }

        // If the key consists of multiple . parts, we also need to add joins for the other parts
        if (count($parts) > 2) {
            $prefix = array_shift($parts);
            $leftover = implode('.', $parts);
            $key = $this->shouldJoin($leftover, $prefix);
        }

        return $key;
    }
public function shouldJoin($key, $prefix = null)
    {
        $parts = explode('.', $key);

        if (!$prefix) {
            $prefix = $this->getRootAlias();
        }

        if (!in_array($parts[0], $this->qb->getAllAliases())) {
            $this->qb->leftJoin($prefix.'.'.$parts[0], $parts[0]);
        }

        // If the key consists of multiple . parts, we also need to add joins for the other parts
        if (count($parts) > 2) {
            $prefix = array_shift($parts);
            $leftover = implode('.', $parts);
            $key = $this->shouldJoin($leftover, $prefix);
        }

        return $key;
    }
public function shouldJoin ( $ key , $ prefix = null ) { $ parts = explode ( '.' , $ key ) ; if ( ! $ prefix ) { $ prefix = $ this -> getRootAlias ( ) ; } if ( ! in_array ( $ parts [ 0 ] , $ this -> qb -> getAllAliases ( ) ) ) { $ this -> qb -> leftJoin ( $ prefix . '.' . $ parts [ 0 ] , $ parts [ 0 ] ) ; } // If the key consists of multiple . parts, we also need to add joins for the other parts if ( count ( $ parts ) > 2 ) { $ prefix = array_shift ( $ parts ) ; $ leftover = implode ( '.' , $ parts ) ; $ key = $ this -> shouldJoin ( $ leftover , $ prefix ) ; } return $ key ; }
Strips the key parts and creates joins if they don't exist yet.

@param string $key A lowercase dot-separated key. e.g. "content.template.id"

@return string The final key that can be used in e.g. WHERE statements
Strips the key parts and creates joins if they don t exist yet .