final class FakerSeederGenerator extends Generator implements GeneratorInterface (View source)

Generator for dist/database/seeders/*.php.

Constants

private INDENT

The left padding for the body of the generated.

private SUB_INDENT

Properties

protected string $stub from  Generator
protected string|null $namespace from  Generator

Methods

__construct(Table $table, string|null $namespace = null, string|null $destination = null)

No description

void
loadStub(string $filename)

No description

void
defaultDestination(string $path)

No description

void
defaultNamespace(string $namespace)

No description

string
qualifyModel(string $class)

No description

void
write(string $filename, string $content, bool $force = false)

No description

string
read(string $filename)

No description

string
replace(array $search, array $replace)

No description

count(int $count)

Set count values for the generated stub

void
run(bool $force = false)

Run the generator logic and save it to a file.

static void
make(Table $table, string|null $namespace = null, string|null $destination = null)

Create a instance.

Details

protected __construct(Table $table, string|null $namespace = null, string|null $destination = null)

No description

Parameters

Table $table
string|null $namespace
string|null $destination

protected void loadStub(string $filename)

No description

Parameters

string $filename

Return Value

void

protected void defaultDestination(string $path)

No description

Parameters

string $path

Return Value

void

protected void defaultNamespace(string $namespace)

No description

Parameters

string $namespace

Return Value

void

protected string qualifyModel(string $class)

No description

Parameters

string $class

Return Value

string

protected void write(string $filename, string $content, bool $force = false)

No description

Parameters

string $filename
string $content
bool $force

Return Value

void

protected string read(string $filename)

No description

Parameters

string $filename

Return Value

string

protected string replace(array $search, array $replace)

No description

Parameters

array $search
array $replace

Return Value

string

FakerSeederGenerator count(int $count)

Set count values for the generated stub

Parameters

int $count

Return Value

FakerSeederGenerator

void run(bool $force = false)

Run the generator logic and save it to a file.

Parameters

bool $force

Whether to force the generation of the generator file or not.

Return Value

void

static void make(Table $table, string|null $namespace = null, string|null $destination = null)

Create a instance.

Parameters

Table $table
string|null $namespace

The namespace to be applied to the class

string|null $destination

The path to the dist folder

Return Value

void