Skip to main content

GravityKit\GravityMigrate\Schema\RowPacker

Packs fields into rows of twelve columns.

Gravity Forms lays a row out in twelfths, so fields sharing a row have to add up to twelve and a field that will not fit starts a new one. Getting the packing wrong fails quietly: the form still imports and the fields simply sit in the wrong rows.

Since: %ver%

Source: src/Schema/RowPacker.php:14

Details

  • Kind: class
  • Namespace: GravityKit\GravityMigrate\Schema

Methods

MethodDescription
add()Puts a field in the current row, or starts a new one if it does not fit.
break_row()Closes the row being built, if anything is in it.
each_row()Hands each row to the given callback, closing the last one first.

Method Reference

add()

public function add( int $index, int $span, bool $begins_row=false ): void

Puts a field in the current row, or starts a new one if it does not fit.

Parameters

NameTypeDefaultDescription
$indexintWhere the field sits in the form.
$spanintHow many of the twelve columns it takes.
$begins_rowboolfalseWhether the field says it starts a row regardless.

Returns

  • void

Since: %ver%

Source: src/Schema/RowPacker.php:72

break_row()

public function break_row(): void

Closes the row being built, if anything is in it.

A field that has no width of its own, a page break or a section, ends the row it follows.

Returns

  • void

Since: %ver%

Source: src/Schema/RowPacker.php:95

each_row()

public function each_row( callable $callback ): void

Hands each row to the given callback, closing the last one first.

Parameters

NameTypeDefaultDescription
$callbackcallableTakes the field indexes and their widths.

Returns

  • void

Since: %ver%

Source: src/Schema/RowPacker.php:115