original_string: public static function checkFieldExists(TableMap $tableMap, $field)
      {
          $column = null;
          try {
              foreach($tableMap->getColumns() as $tableMapColumn) {
                  $columnName = $tableMapColumn->getPhpName();
                  if(preg_match('/^'.$field.'$/i', $columnName)) {
                      $column = $tableMapColumn;
                      break;
                  }
              }
          } catch (\Exception $e) {
              Logger::log($e->getMessage(), LOG_DEBUG);
          }
          return $column;
      }
code: public static function checkFieldExists(TableMap $tableMap, $field)
      {
          $column = null;
          try {
              foreach($tableMap->getColumns() as $tableMapColumn) {
                  $columnName = $tableMapColumn->getPhpName();
                  if(preg_match('/^'.$field.'$/i', $columnName)) {
                      $column = $tableMapColumn;
                      break;
                  }
              }
          } catch (\Exception $e) {
              Logger::log($e->getMessage(), LOG_DEBUG);
          }
          return $column;
      }
code_tokens: public static function checkFieldExists ( TableMap $ tableMap , $ field ) { $ column = null ; try { foreach ( $ tableMap -> getColumns ( ) as $ tableMapColumn ) { $ columnName = $ tableMapColumn -> getPhpName ( ) ; if ( preg_match ( '/^' . $ field . '$/i' , $ columnName ) ) { $ column = $ tableMapColumn ; break ; } } } catch ( \ Exception $ e ) { Logger :: log ( $ e -> getMessage ( ) , LOG_DEBUG ) ; } return $ column ; }
docstring: Check if parametrized field exists in api model
  @param TableMap $tableMap
  @param $field
  @return \Propel\Runtime\Map\ColumnMap|null
docstring_tokens: Check if parametrized field exists in api model