Ubuntu Manpages

LedgerSMB::File

Provides routines for managing file attachments.

This provides routines for managing file attachments. Subclasses may be used to provide functionality for specific types of file attachments.

Entity id of the individual who attached the file.
Entity name of individual who attached file
Timestamp of attachment point.
This stores the binary content of the file.
ID of the MIME type. Undef if unknown.
Standard text code of the MIME type
File name, user specified
Description, user specified
ID of file. undef if unknown
Referential key for the file to attach to.
Reference control code (text string) for attached financial database object.
ID of the file class.
ID of class of the original attachment point (for a link)
Path, relative to $LedgerSMB::tempdir, where file data is stored (for LaTeX use of attached images).
Object for db interface.
X axis dimensions, if Image::Size is installed and file is image (only on files retrieved for invoices).
Y axis dimensions, if Image::Size is installed and file is image (only on files retrieved for invoices).
A hash for extended information

Note additionally the $self hashref contains the basic required attributes for DBObject, namely dbh, _roles, and _locale.

Returns a blessed object
Returns a hashref of properties for the object.
$file->new_dbobject({base => (LedgerSMB | LedgerSMB::Form), locale => LedgerSMB::Locale});

Creates a new file object. Locale only needs to be specified when using LedgerSMB::Form objects since these are not included.

Returns 0 on success.

Error codes on exit (OR'd):

1: No database handle included 2: No locale handle included 4: Invalid base.

In most cases when working with new code it is simpler to just

$file->dbobject(LedgerSMB::DBObject->new({base => $request});

Sends the textual representation of the MIME type. If not set, retrieves and sets it.
Sets the mipe_type_id from the mime_type_text
Auto-detects the type of the file. Not yet implemented
Retrives a file. ID and file_class properties must be set.
Returns file data for invoices for embedded images, except that content is set to a directive relative to tempdir where these files are stored.
Lists files directly attached to the object.
Lists the links directly attached to the object.
Provides a compatible interface to LedgerSMB::DBObject::exec_method
Merges in specific attributes from the ref.
Returns the value of DBI->commit

Copyright (C) 2011 The LedgerSMB Core Team

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.