.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "LedgerSMB::File 3pm" .TH LedgerSMB::File 3pm "2012-05-14" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" LedgerSMB::File \- Provides routines for managing file attachments. .SH "SYNPSIS" .IX Header "SYNPSIS" This provides routines for managing file attachments. Subclasses may be used to provide functionality for specific types of file attachments. .SH "PROPERTIES/ACCESSORS" .IX Header "PROPERTIES/ACCESSORS" .IP "attached_by_id" 4 .IX Item "attached_by_id" Entity id of the individual who attached the file. .IP "attached_by" 4 .IX Item "attached_by" Entity name of individual who attached file .IP "attached_at" 4 .IX Item "attached_at" Timestamp of attachment point. .IP "content" 4 .IX Item "content" This stores the binary content of the file. .IP "mime_type_id" 4 .IX Item "mime_type_id" \&\s-1ID\s0 of the \s-1MIME\s0 type. Undef if unknown. .IP "mime_type_text" 4 .IX Item "mime_type_text" Standard text code of the \s-1MIME\s0 type .IP "file_name" 4 .IX Item "file_name" File name, user specified .IP "description" 4 .IX Item "description" Description, user specified .IP "id" 4 .IX Item "id" \&\s-1ID\s0 of file. undef if unknown .IP "ref_key" 4 .IX Item "ref_key" Referential key for the file to attach to. .IP "reference" 4 .IX Item "reference" Reference control code (text string) for attached financial database object. .IP "file_class" 4 .IX Item "file_class" \&\s-1ID\s0 of the file class. .IP "src_class" 4 .IX Item "src_class" \&\s-1ID\s0 of class of the original attachment point (for a link) .IP "file_path" 4 .IX Item "file_path" Path, relative to \f(CW$LedgerSMB::tempdir\fR, where file data is stored (for LaTeX use of attached images). .IP "dbobject" 4 .IX Item "dbobject" Object for db interface. .IP "sizex" 4 .IX Item "sizex" X axis dimensions, if Image::Size is installed and file is image (only on files retrieved for invoices). .IP "sizey" 4 .IX Item "sizey" Y axis dimensions, if Image::Size is installed and file is image (only on files retrieved for invoices). .IP "x_info" 4 .IX Item "x_info" A hash for extended information .Sp Note additionally the \f(CW$self\fR hashref contains the basic required attributes for DBObject, namely dbh, _roles, and _locale. .SH "METHODS" .IX Header "METHODS" .IP "new" 4 .IX Item "new" Returns a blessed object .IP "to_hashref" 4 .IX Item "to_hashref" Returns a hashref of properties for the object. .IP "new_dbobject" 4 .IX Item "new_dbobject" \&\f(CW$file\fR\->new_dbobject({base => (LedgerSMB | LedgerSMB::Form), locale => LedgerSMB::Locale}); .Sp Creates a new file object. Locale only needs to be specified when using LedgerSMB::Form objects since these are not included. .Sp Returns 0 on success. .Sp Error codes on exit (\s-1OR\s0'd): .Sp 1: No database handle included 2: No locale handle included 4: Invalid base. .Sp In most cases when working with new code it is simpler to just .Sp \&\f(CW$file\fR\->dbobject(LedgerSMB::DBObject\->new({base => \f(CW$request\fR}); .IP "get_mime_type" 4 .IX Item "get_mime_type" Sends the textual representation of the \s-1MIME\s0 type. If not set, retrieves and sets it. .IP "set_mime_type" 4 .IX Item "set_mime_type" Sets the mipe_type_id from the mime_type_text .IP "detect_type" 4 .IX Item "detect_type" Auto-detects the type of the file. Not yet implemented .IP "get" 4 .IX Item "get" Retrives a file. \s-1ID\s0 and file_class properties must be set. .IP "get_for_template({ref_key => int, file_class => int})" 4 .IX Item "get_for_template({ref_key => int, file_class => int})" Returns file data for invoices for embedded images, except that content is set to a directive relative to tempdir where these files are stored. .IP "list({ref_key => int, file_class => int})" 4 .IX Item "list({ref_key => int, file_class => int})" Lists files directly attached to the object. .IP "list_links({ref_key => int, file_class => int})" 4 .IX Item "list_links({ref_key => int, file_class => int})" Lists the links directly attached to the object. .IP "exec_method" 4 .IX Item "exec_method" Provides a compatible interface to LedgerSMB::DBObject::exec_method .IP "merge(hashref)" 4 .IX Item "merge(hashref)" Merges in specific attributes from the ref. .IP "\fIcommit()\fR" 4 .IX Item "commit()" Returns the value of \s-1DBI\-\s0>commit .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2011 The LedgerSMB Core Team .PP This file is licensed under the Gnu General Public License version 2, or at your option any later version. A copy of the license should have been included with your software.