original_string: private function checkFieldIsAvailable($field, &$availableTables)
      {
          $fieldParts = explode('.', $field);
  
          $table = count($fieldParts) == 2 ? $fieldParts[0] : false;
  
          // remove sql functions from field name
          // example: `HOUR(log_visit.visit_last_action_time)` gets `HOUR(log_visit` => remove `HOUR(`
          $table = preg_replace('/^[A-Z_]+\(/', '', $table);
          $tableExists = !$table || in_array($table, $availableTables);
  
          if ($tableExists) {
              return;
          }
  
          if (is_array($availableTables)) {
              foreach ($availableTables as $availableTable) {
                  if (is_array($availableTable)) {
                      if (!isset($availableTable['tableAlias']) && $availableTable['table'] === $table) {
                          return;
                      } elseif (isset($availableTable['tableAlias']) && $availableTable['tableAlias'] === $table) {
                          return;
                      }
                  }
              }
          }
  
          $availableTables[] = $table;
      }
code: private function checkFieldIsAvailable($field, &$availableTables)
      {
          $fieldParts = explode('.', $field);
  
          $table = count($fieldParts) == 2 ? $fieldParts[0] : false;
  
          // remove sql functions from field name
          // example: `HOUR(log_visit.visit_last_action_time)` gets `HOUR(log_visit` => remove `HOUR(`
          $table = preg_replace('/^[A-Z_]+\(/', '', $table);
          $tableExists = !$table || in_array($table, $availableTables);
  
          if ($tableExists) {
              return;
          }
  
          if (is_array($availableTables)) {
              foreach ($availableTables as $availableTable) {
                  if (is_array($availableTable)) {
                      if (!isset($availableTable['tableAlias']) && $availableTable['table'] === $table) {
                          return;
                      } elseif (isset($availableTable['tableAlias']) && $availableTable['tableAlias'] === $table) {
                          return;
                      }
                  }
              }
          }
  
          $availableTables[] = $table;
      }
code_tokens: private function checkFieldIsAvailable ( $ field , & $ availableTables ) { $ fieldParts = explode ( '.' , $ field ) ; $ table = count ( $ fieldParts ) == 2 ? $ fieldParts [ 0 ] : false ; // remove sql functions from field name // example: `HOUR(log_visit.visit_last_action_time)` gets `HOUR(log_visit` => remove `HOUR(` $ table = preg_replace ( '/^[A-Z_]+\(/' , '' , $ table ) ; $ tableExists = ! $ table || in_array ( $ table , $ availableTables ) ; if ( $ tableExists ) { return ; } if ( is_array ( $ availableTables ) ) { foreach ( $ availableTables as $ availableTable ) { if ( is_array ( $ availableTable ) ) { if ( ! isset ( $ availableTable [ 'tableAlias' ] ) && $ availableTable [ 'table' ] === $ table ) { return ; } elseif ( isset ( $ availableTable [ 'tableAlias' ] ) && $ availableTable [ 'tableAlias' ] === $ table ) { return ; } } } } $ availableTables [ ] = $ table ; }
docstring: Check whether the field is available
  If not, add it to the available tables
  
  @param string $field
  @param array $availableTables
docstring_tokens: Check whether the field is available If not add it to the available tables