---
name: "DBIx::Class::Schema::PopulateMore::Command"
section: "3pm"
platform: "linux"
package: "libdbix-class-schema-populatemore-perl"
version: "0.19-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/DBIx::Class::Schema::PopulateMore::Command"
---

# DBIx::Class::Schema::PopulateMore::Command(3pm)

Command Class to Populate a Schema

## NAME

DBIx::Class::Schema::PopulateMore::Command - Command Class to Populate a Schema

## DESCRIPTION

This is a command pattern  class to manage the job of populating a DBIx::Class::Schema with information.  We break this out because the actual job is a bit complex, is likely to grow more complex, and so that we can more easily identify refactorable and reusable parts.

## ATTRIBUTES

This class defines the following attributes.

### schema

This is the Schema we are populating

### exception\_cb

contains a callback to the exception method supplied by DBIC

### definitions

This is an arrayref of information used to populate tables in the database

### match\_condition

How we know the value is really something to inflate or perform a substitution on.  This get's the namespace of the substitution plugin and it's other data.

### visitor

We define a visitor so that we can perform the value inflations and or  substitutions.  This is still a little work in progress, but it's getting  neater

### rs\_index

The index of previously inflated resultsets.  Basically when we create a new row in the table, we cache the result object so that it can be used as a  dependency in creating another.

Eventually will be moved into the constructor for a plugin

### set\_rs\_index

Set an index value to an inflated result

### get\_rs\_index

given an index, returns the related inflated resultset

### inflator\_loader

Loads each of the available inflators, provider access to the objects

### inflator\_dispatcher

Holds an object that can perform dispatching to the inflators.

## METHODS

This module defines the following methods.

### \_build\_visitor

lazy build for the "visitor" attribute.

### \_build\_inflator\_loader

lazy build for the "inflator\_loader" attribute

### \_build\_inflator\_dispatcher

lazy build for the "inflator\_dispatcher" attribute

### execute

The command classes main method.  Returns a Hash of the created result rows, where each key is the named index and the value is the row object.

### dispatch\_inflator

Dispatch to the correct inflator

### create\_fixture({})

Given a hash suitable for a DBIx::Class::Resultset create method, attempt to update or create a row in the named source.

returns the newly created row or throws an exception if there is a failure

### merge\_fields\_values

Given a fields and values, combine to a hash suitable for using in a create\_fixture row statement.

### field\_value

Correctly create an array from the fields, values variables, skipping those where the value is undefined.

### coerce\_to\_array

given a value that is either an arrayref or a scalar, put it into array context and return that array.

## AUTHOR

Please see DBIx::Class::Schema::PopulateMore For authorship information

## LICENSE

Please see DBIx::Class::Schema::PopulateMore For licensing terms.
