Created callback, triggers watches on the parent(!) object.
Simple creation event handler which fills out the location field if it
is still empty with a location generated by _create_attachment_location().
booleanTrue if creation may commence.
Deleted callback, triggers watches on the parent(!) object.
Updated callback, triggers watches on the parent(!) object.
This function closes the open write handle obtained by the open() call again.
It is required to call this function instead of a simple fclose to ensure proper
copy_from_file (string $filename)
Updates the contents of the attachments with the contents of the file specified.
This is a wrapper for copy_from_handle.
stringThe file to read.
copy_from_handle (resource $source)
Updates the contents of the attachments with the contents of the resource identified
by the filehandle passed.
resourceThe handle to read from.
copy_from_memory (mixed $source)
Updates the contents of the attachments with the contents given.
Get the path to the document in the static cache
get_parent_guid_uncached_static ($guid, $classname)
Returns the Parent of the Attachment, which is identified by the table/id combination
in the attachment record.
The table in question is used to identify the object to
use. If multiple objects are registered for a given table, the first matching class
returned by the dbfactory is used (which is usually rather arbitrary).
Opens the attachment for file IO, the semantics match the original
Returns a filehandle that can be used with the
usual PHP file functions if successful, the handle has to be closed with
the close() method when you no longer need it, don't let it fall over
the end of the script.
Important Note: It is important to use the close() member function of
this class to close the file handle, not just fclose(). Otherwise, the upgrade
notification switches will fail.
resourceA file handle to the attachment if successful, false on failure.
This function reads the file and returns its contents
safe_filename (string $filename, boolean $force_single_extension)
Rewrite a filename to URL safe form
||add possibility to use the file utility to determine extension if missing.
stringfile name to rewrite
booleanforce file to single extension (defaults to true)
Simple wrapper for stat() on the blob object.
mixedEither a stat array as for stat() or false on failure.
Internal tracking state variable, true if the attachment has a handle opened in write mode
Internal tracking state variable, holds the file handle of any open