Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbix::class::inflatecolumn::file(3) [osx man page]

DBIx::Class::InflateColumn::File(3)			User Contributed Perl Documentation		       DBIx::Class::InflateColumn::File(3)

DBIx::Class::InflateColumn::File - DEPRECATED (superseded by DBIx::Class::InflateColumn::FS) Deprecation Notice This component has a number of architectural deficiencies that can quickly drive your filesystem and database out of sync and is not recommended for further use. It will be retained for backwards compatibility, but no new functionality patches will be accepted. Please consider using the much more mature and actively supported DBIx::Class::InflateColumn::FS. You can set the environment variable DBIC_IC_FILE_NOWARN to a true value to disable this warning. SYNOPSIS
In your DBIx::Class table class: use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw/InflateColumn::File/); # define your columns __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0, size => 4, }, "filename", { data_type => "varchar", is_file_column => 1, file_column_path =>'/tmp/uploaded_files', # or for a Catalyst application # file_column_path => MyApp->path_to('root','static','files'), default_value => undef, is_nullable => 1, size => 255, }, ); In your Catalyst::Controller class: FileColumn requires a hash that contains IO::File as handle and the file's name as name. my $entry = $c->model('MyAppDB::Articles')->create({ subject => 'blah', filename => { handle => $c->req->upload('myupload')->fh, filename => $c->req->upload('myupload')->basename }, body => '....' }); $c->stash->{entry}=$entry; And Place the following in your TT template Article Subject: [% entry.subject %] Uploaded File: <a href="/static/files/[% %]/[% entry.filename.filename %]">File</a> Body: [% entry.body %] The file will be stored on the filesystem for later retrieval. Calling delete on your resultset will delete the file from the filesystem. Retrevial of the record automatically inflates the column back to the set hash with the IO::File handle and filename. DESCRIPTION
InflateColumn::File METHODS
_file_column_callback ($file,$ret,$target) Method made to be overridden for callback purposes. AUTHOR
Victor Igumnov LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-08-16 DBIx::Class::InflateColumn::File(3)

Check Out this Related Man Page

DBIx::Class::InflateColumn::IP(3pm)			User Contributed Perl Documentation		       DBIx::Class::InflateColumn::IP(3pm)

DBIx::Class::InflateColumn::IP - Auto-create NetAddr::IP objects from columns. SYNOPSIS
Load this component and declare columns as IP addresses with the appropriate format. package Host; __PACKAGE__->load_components(qw/InflateColumn::IP Core/); __PACKAGE__->add_columns( ip_address => { data_type => 'bigint', is_nullable => 0, is_ip => 1, ip_format => 'numeric', } ); package Network; __PACKAGE__->load_components(qw/InflateColumn::IP Core/); __PACKAGE__->add_columns( address => { data_type => 'varchar', size => 18 is_nullable => 0, is_ip => 1, ip_format => 'cidr', } ); Then you can treat the specified column as a NetAddr::IP object. print 'IP address: ', $host->ip_address->addr; print 'Address type: ', $host->ip_address->iptype; DBIx::Class::InflateColumn::IP supports a limited amount of auto-detection of the format based on the column type. If the type begins with "int" or "bigint", it's assumed to be numeric, while "inet" and "cidr" (as used by e.g. PostgreSQL) are assumed to be "cidr" format. METHODS
ip_class Arguments: $class Gets/sets the address class that the columns should be inflated into. The default class is NetAddr::IP. ip_format Arguments: $format Gets/sets the name of the method used to deflate the address for the database. This must return a value suitable for "$ip_class-"new(); The default format is "addr", which returns the address in dotted-quad notation. See "Methods" in NetAddr::IP for suitable values. register_column Chains with "register_column" in DBIx::Class::Row, and sets up IP address columns appropriately. This would not normally be called directly by end users. AUTHOR
Dagfinn Ilmari Mannsaaker, "<ilmari at>" BUGS
Please report any bugs or feature requests to "bug-dbix-class-inflatecolumn-ip at", or through the web interface at < InflateColumn-IP>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc DBIx::Class::InflateColumn::IP You can also look for information at: o AnnoCPAN: Annotated CPAN documentation <> o CPAN Ratings <> o RT: CPAN's request tracker < InflateColumn-IP> o Search CPAN <> SEE ALSO
DBIx::Class, NetAddr::IP COPYRIGHT &; LICENSE Copyright 2007 Dagfinn Ilmari Mannsaaker, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-11-29 DBIx::Class::InflateColumn::IP(3pm)
Man Page