From: Dagfinn Ilmari Mannsåker Date: Mon, 10 Apr 2017 14:17:00 +0000 (+0100) Subject: Improve col_accessor_map coderef documentation X-Git-Tag: 0.07047~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1cf6e186f998179c5637fa9c0ecc7731d6c6290b;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Improve col_accessor_map coderef documentation Use a proper list for the coderef arguments and be more consistent about how we refer to the column/table objects. --- diff --git a/Changes b/Changes index 2546338..f3a109b 100644 --- a/Changes +++ b/Changes @@ -2,7 +2,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader - Avoid upcoming DBIC warning on implicit SELECT * invocation (RT#118178) - - Improve moniker_map coderef documentation (GH#7) + - Improve moniker_map and col_accessor_map coderef documentation (GH#7) 0.07046 2016-09-05 - Introspect view definitions for PostgreSQL, MySQL, Oracle, diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index a0b252d..add0985 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -677,23 +677,36 @@ L takes precedence over this. Same as moniker_map, but for column accessor names. The nested hashref form is traversed according to L, with an extra level at the bottom for the column name. If a coderef is -passed, the code is called with arguments of +passed, the code is called with the following arguments: + +=over + +=item * + +the L object for the column + +=item * + +the default accessor name that DBICSL would ordinarily give this column + +=item * + +a hashref of this form: - the DBIx::Class::Schema::Loader::Column object for the column, - default accessor name that DBICSL would ordinarily give this column, { table_class => name of the DBIC class we are building, table_moniker => calculated moniker for this table (after moniker_map if present), - table => table object of interface DBIx::Class::Schema::Loader::Table, + table => the DBIx::Class::Schema::Loader::Table object for the table, full_table_name => schema-qualified name of the database table (RDBMS specific), schema_class => name of the schema class we are building, column_info => hashref of column info (data_type, is_nullable, etc), } - coderef ref that can be called with a hashref map -The L and -L objects stringify to their -unqualified names. +=item * + +a coderef that can be called with a hashref map + +=back =head2 rel_name_map