![]() |
![]()
| ![]() |
![]()
NAMEDBIx::Class::Schema::PopulateMore::Command - Command Class to Populate a Schema DESCRIPTIONThis 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. ATTRIBUTESThis class defines the following attributes. schemaThis is the Schema we are populating exception_cbcontains a callback to the exception method supplied by DBIC definitionsThis is an arrayref of information used to populate tables in the database match_conditionHow 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. visitorWe 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_indexThe 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_indexSet an index value to an inflated result get_rs_indexgiven an index, returns the related inflated resultset inflator_loaderLoads each of the available inflators, provider access to the objects inflator_dispatcherHolds an object that can perform dispatching to the inflators. METHODSThis module defines the following methods. _build_visitorlazy build for the "visitor" attribute. _build_inflator_loaderlazy build for the "inflator_loader" attribute _build_inflator_dispatcherlazy build for the "inflator_dispatcher" attribute executeThe 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_inflatorDispatch 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_valuesGiven a fields and values, combine to a hash suitable for using in a create_fixture row statement. field_valueCorrectly create an array from the fields, values variables, skipping those where the value is undefined. coerce_to_arraygiven a value that is either an arrayref or a scalar, put it into array context and return that array. AUTHORPlease see DBIx::Class::Schema::PopulateMore For authorship information LICENSEPlease see DBIx::Class::Schema::PopulateMore For licensing terms.
|