original_string: protected function _deleteQueryTranslator($query)
      {
          $hadAlias = false;
          $tables = [];
          foreach ($query->clause('from') as $alias => $table) {
              if (is_string($alias)) {
                  $hadAlias = true;
              }
              $tables[] = $table;
          }
          if ($hadAlias) {
              $query->from($tables, true);
          }
  
          if (!$hadAlias) {
              return $query;
          }
  
          return $this->_removeAliasesFromConditions($query);
      }
code: protected function _deleteQueryTranslator($query)
      {
          $hadAlias = false;
          $tables = [];
          foreach ($query->clause('from') as $alias => $table) {
              if (is_string($alias)) {
                  $hadAlias = true;
              }
              $tables[] = $table;
          }
          if ($hadAlias) {
              $query->from($tables, true);
          }
  
          if (!$hadAlias) {
              return $query;
          }
  
          return $this->_removeAliasesFromConditions($query);
      }
code_tokens: protected function _deleteQueryTranslator ( $ query ) { $ hadAlias = false ; $ tables = [ ] ; foreach ( $ query -> clause ( 'from' ) as $ alias => $ table ) { if ( is_string ( $ alias ) ) { $ hadAlias = true ; } $ tables [ ] = $ table ; } if ( $ hadAlias ) { $ query -> from ( $ tables , true ) ; } if ( ! $ hadAlias ) { return $ query ; } return $ this -> _removeAliasesFromConditions ( $ query ) ; }
docstring: Apply translation steps to delete queries.
  
  Chops out aliases on delete query conditions as most database dialects do not
  support aliases in delete queries. This also removes aliases
  in table names as they frequently don't work either.
  
  We are intentionally not supporting deletes with joins as they have even poorer support.
  
  @param \Cake\Database\Query $query The query to translate
  @return \Cake\Database\Query The modified query
docstring_tokens: Apply translation steps to delete queries .