Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbix::class::inflatecolumn::file5.18(3) [mojave man page]

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

NAME
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.id %]/[% 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.18.2 2013-09-24 DBIx::Class::InflateColumn::File(3)

Check Out this Related Man Page

DBIx::Class::DateTime::Epoch(3pm)			User Contributed Perl Documentation			 DBIx::Class::DateTime::Epoch(3pm)

NAME
DBIx::Class::DateTime::Epoch - Automatic inflation/deflation of epoch-based columns to/from DateTime objects SYNOPSIS
package MySchema::Foo; use base qw( DBIx::Class ); __PACKAGE__->load_components( qw( DateTime::Epoch TimeStamp Core ) ); __PACKAGE__->add_columns( name => { data_type => 'varchar', size => 10, }, bar => { # epoch stored as an int data_type => 'bigint', inflate_datetime => 1, }, baz => { # epoch stored as a string data_type => 'varchar', size => 50, inflate_datetime => 'epoch', }, # working in conjunction with DBIx::Class::TimeStamp creation_time => { data_type => 'bigint', inflate_datetime => 1, set_on_create => 1, }, modification_time => { data_type => 'bigint', inflate_datetime => 1, set_on_create => 1, set_on_update => 1, } ); DATETIME
::FORMAT DEPENDENCY There have been no assumptions made as to what RDBMS you will be using. As per the note in the DBIx::Class::InflateColumn::DateTime documentation, you will need to install the DateTime::Format::* module that matches your RDBMS of choice. DESCRIPTION
This module automatically inflates/deflates DateTime objects from/to epoch values for the specified columns. This module is essentially an extension to DBIx::Class::InflateColumn::DateTime so all of the settings, including "locale" and "timezone", are also valid. A column will be recognized as an epoch time given one of the following scenarios: o "data_type" is an "int" of some sort and "inflate_datetime" is also set to a true value o "data_type" is some other value (e.g. "varchar") and "inflate_datetime" is explicitly set to "epoch". DBIx::Class::TimeStamp can also be used in conjunction with this module to support epoch-based columns that are automatically set on creation of a row and updated subsequent modifications. METHODS
add_columns( ) Provides backwards compatibility with the older DateTime::Epoch API. _inflate_to_datetime( ) Overrides column inflation to use "Datetime->from_epoch". _deflate_from_datetime( ) Overrides column deflation to call "epoch()" on the column value. SEE ALSO
o DBIx::Class o DBIx::Class::TimeStamp o DateTime AUTHORS
Brian Cassidy <bricas@cpan.org> Adam Paynter <adapay@cpan.org> COPYRIGHT AND LICENSE
Copyright 2006-2012 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-01 DBIx::Class::DateTime::Epoch(3pm)
Man Page