| @@ 300-310 (lines=11) @@ | ||
| 297 | /** |
|
| 298 | * {@inheritdoc} |
|
| 299 | */ |
|
| 300 | public function hasColumn($tableName, $columnName) |
|
| 301 | { |
|
| 302 | $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); |
|
| 303 | foreach ($rows as $column) { |
|
| 304 | if (strcasecmp($column['name'], $columnName) === 0) { |
|
| 305 | return true; |
|
| 306 | } |
|
| 307 | } |
|
| 308 | ||
| 309 | return false; |
|
| 310 | } |
|
| 311 | ||
| 312 | /** |
|
| 313 | * {@inheritdoc} |
|
| @@ 358-368 (lines=11) @@ | ||
| 355 | /** |
|
| 356 | * {@inheritdoc} |
|
| 357 | */ |
|
| 358 | public function hasColumn( $tableName, $columnName ) { |
|
| 359 | $rows = $this->fetchAll( sprintf( 'SHOW COLUMNS FROM %s', $this->quoteTableName( $tableName ) ) ); |
|
| 360 | foreach ( $rows as $column ) { |
|
| 361 | if ( strcasecmp( $column['Field'], $columnName ) === 0 ) { |
|
| 362 | return true; |
|
| 363 | } |
|
| 364 | } |
|
| 365 | ||
| 366 | return false; |
|
| 367 | } |
|
| 368 | ||
| 369 | /** |
|
| 370 | * {@inheritdoc} |
|
| 371 | */ |
|