- /**
- * 2016-11-01
- * http://stackoverflow.com/a/7264865
- * 2016-11-04
- * My previous implementation:
- $table = df_table($table);
- $query = df_db_quote_into("SHOW COLUMNS FROM `{$table}` LIKE ?", $column);
- return !!df_conn()->query($query)->fetchColumn();
- * It is also correct, I used it before I found the
- * @uses \Magento\Framework\DB\Adapter\Pdo\Mysql::tableColumnExists() method.
- *
- * @param string $table
- * @param string $column
- * @return bool
- */
- function df_db_column_exists($table, $column) {return
- /**
- * 2016-11-04
- * @uses df_table() call is required here,
- * because @uses \Magento\Framework\DB\Adapter\Pdo\Mysql::tableColumnExists() method
- * does not add the custom table prefix to the $name.
- * The custom table prefix could be set my a Magento 2 administrator
- * during Magento 2 intallation (see the «table_prefix» key in the app/etc/env.php file).
- */
- df_conn()->tableColumnExists(df_table($table), $column)
- ;}