[Dbix-class] Is inflation the default?

Alexander Hartmaier alexander.hartmaier at t-systems.at
Mon Feb 11 09:04:11 GMT 2013


On 2013-02-08 19:59, Joe Carlson wrote:
> Hey,
>
> Thanks for DBIx::Class. I am liking it.
>
> But I'm confused by inflation. I'm using 0.08120 - I know it's not the latest, but it's what I can use - and Class::Schema::Loader::make_schema_at to write the class modules.
>
> Are columns with foreign key constraints inflated by default? I don't how this is set when the classes are written, or how I can control the behavior. I'd like to control what gets returned by the column accessor methods a little better to not return the record referenced by the foreign key in some cases. It appears I always get the entire record when I call
>
> $ManyToManyTableRow->column_with_foreign_key_constraint.
>
> Thanks
Hi Joe,
the relationship accessors return the related object(s). If their names
are equal to the foreign key column name the column and the relationship
accessors overlap and fulfill both purposes. I'd recommend to use
different names for them, for example $row->$colname and
$row->rel_$colname is my naming scheme.

> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the DBIx-Class mailing list