abstract class Factory (View source)

Properties

protected int $count

How many is it creating the row

protected int $bundleSize

The number of order lines to generate for each order.

protected array $state

Change key-value pairs in the definition

Methods

array
definition()

Define a factory definition for online mall companies

static Factory
make()

Create a new Factory instance

count(int|null $count = null)

Update the count of the returned definitions

bundle(int $bundleSize)

Set the number of rows to create for each order.

state(array $state)

Update the state of the returned definitions

array
create()

Create definition(s) with the given state and count

array
header()

Get header cells

array
applyState(array $record)

Apply configured values to a generated record.

Details

abstract array definition()

Define a factory definition for online mall companies

Return Value

array

The method returns a row of a specific order sheet for a company

static Factory make()

Create a new Factory instance

Return Value

Factory

The method returns a new Factory instance

Factory count(int|null $count = null)

Update the count of the returned definitions

Parameters

int|null $count

The new count

Return Value

Factory

The method returns the new count

Factory bundle(int $bundleSize)

Set the number of rows to create for each order.

Factories that support grouped orders use this value to share order-level fields and calculate bundle totals.

Parameters

int $bundleSize

Return Value

Factory

Exceptions

InvalidArgumentException

Factory state(array $state)

Update the state of the returned definitions

Parameters

array $state

The new state

Return Value

Factory

The method returns the new state

array create()

Create definition(s) with the given state and count

Return Value

array

The method returns the definition with the given state and count

array header()

Get header cells

Return Value

array

The header cells

protected array applyState(array $record)

Apply configured values to a generated record.

Parameters

array $record

Return Value

array