Automattic\WooCommerce\Blueprint\Steps
RunSql::from_table_row
Build a RunSql step for a database row, using the portable table-prefix placeholder in place of the live database prefix.
Pass the unprefixed table name (e.g. 'woocommerce_shipping_zones'). The placeholder is prepended for you, so exported SQL stays portable across sites with different table prefixes. On import, ImportRunSql resolves the placeholder back to the importing site's prefix.
Метод класса: RunSql{}
Хуков нет.
Возвращает
self.
Использование
$result = RunSql::from_table_row( $row, $table, $type ): self;
- $row(массив) (обязательный)
- Row data keyed by column name.
- $table(строка) (обязательный)
- Unprefixed table name.
- $type(строка)
- One of insert, insert ignore, replace into.
По умолчанию:'replace into'
Код RunSql::from_table_row() RunSql::from table row WC 11.3.0
public static function from_table_row( array $row, string $table, string $type = 'replace into' ): self {
return new self( (string) Util::array_to_insert_sql( $row, self::TABLE_PREFIX_PLACEHOLDER . $table, $type ) );
}