original_string: public function queryTranslator($type)
      {
          return function ($query) use ($type) {
              if ($this->isAutoQuotingEnabled()) {
                  $query = (new IdentifierQuoter($this))->quote($query);
              }
  
              /** @var \Cake\ORM\Query $query */
              $query = $this->{'_' . $type . 'QueryTranslator'}($query);
              $translators = $this->_expressionTranslators();
              if (!$translators) {
                  return $query;
              }
  
              $query->traverseExpressions(function ($expression) use ($translators, $query) {
                  foreach ($translators as $class => $method) {
                      if ($expression instanceof $class) {
                          $this->{$method}($expression, $query);
                      }
                  }
              });
  
              return $query;
          };
      }
code: public function queryTranslator($type)
      {
          return function ($query) use ($type) {
              if ($this->isAutoQuotingEnabled()) {
                  $query = (new IdentifierQuoter($this))->quote($query);
              }
  
              /** @var \Cake\ORM\Query $query */
              $query = $this->{'_' . $type . 'QueryTranslator'}($query);
              $translators = $this->_expressionTranslators();
              if (!$translators) {
                  return $query;
              }
  
              $query->traverseExpressions(function ($expression) use ($translators, $query) {
                  foreach ($translators as $class => $method) {
                      if ($expression instanceof $class) {
                          $this->{$method}($expression, $query);
                      }
                  }
              });
  
              return $query;
          };
      }
code_tokens: public function queryTranslator ( $ type ) { return function ( $ query ) use ( $ type ) { if ( $ this -> isAutoQuotingEnabled ( ) ) { $ query = ( new IdentifierQuoter ( $ this ) ) -> quote ( $ query ) ; } /** @var \Cake\ORM\Query $query */ $ query = $ this -> { '_' . $ type . 'QueryTranslator' } ( $ query ) ; $ translators = $ this -> _expressionTranslators ( ) ; if ( ! $ translators ) { return $ query ; } $ query -> traverseExpressions ( function ( $ expression ) use ( $ translators , $ query ) { foreach ( $ translators as $ class => $ method ) { if ( $ expression instanceof $ class ) { $ this -> { $ method } ( $ expression , $ query ) ; } } } ) ; return $ query ; } ; }
docstring: Returns a callable function that will be used to transform a passed Query object.
  This function, in turn, will return an instance of a Query object that has been
  transformed to accommodate any specificities of the SQL dialect in use.
  
  @param string $type the type of query to be transformed
  (select, insert, update, delete)
  @return callable
docstring_tokens: Returns a callable function that will be used to transform a passed Query object . This function in turn will return an instance of a Query object that has been transformed to accommodate any specificities of the SQL dialect in use .