@@ 365-375 (lines=11) @@ | ||
362 | /** |
|
363 | * {@inheritdoc} |
|
364 | */ |
|
365 | public function hasColumn($tableName, $columnName) |
|
366 | { |
|
367 | $rows = $this->fetchAll(sprintf('SHOW COLUMNS FROM %s', $this->quoteTableName($tableName))); |
|
368 | foreach ($rows as $column) { |
|
369 | if (strcasecmp($column['Field'], $columnName) === 0) { |
|
370 | return true; |
|
371 | } |
|
372 | } |
|
373 | ||
374 | return false; |
|
375 | } |
|
376 | ||
377 | /** |
|
378 | * {@inheritdoc} |
@@ 295-305 (lines=11) @@ | ||
292 | /** |
|
293 | * {@inheritdoc} |
|
294 | */ |
|
295 | public function hasColumn($tableName, $columnName) |
|
296 | { |
|
297 | $rows = $this->fetchAll(sprintf('pragma table_info(%s)', $this->quoteTableName($tableName))); |
|
298 | foreach ($rows as $column) { |
|
299 | if (strcasecmp($column['name'], $columnName) === 0) { |
|
300 | return true; |
|
301 | } |
|
302 | } |
|
303 | ||
304 | return false; |
|
305 | } |
|
306 | ||
307 | /** |
|
308 | * {@inheritdoc} |