From 6064916856c1ab7d618421bf8f57e134b5c0f000 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 12 May 2006 01:16:18 +0000 Subject: [PATCH] r824: Adding attachment API --- includes/api_attachment.php | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 includes/api_attachment.php diff --git a/includes/api_attachment.php b/includes/api_attachment.php new file mode 100644 index 0000000..713aac2 --- /dev/null +++ b/includes/api_attachment.php @@ -0,0 +1,84 @@ +load('api', null); + +/** +* API: Attachment +* +* @author Iris Studios, Inc. +* @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc. +* @version $Revision$ +* @package Bugdar +* +*/ +class AttachmentAPI extends API +{ + /** + * Fields + * @var array + * @access private + */ + var $fields = array( + 'attachmentid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'), + 'bugid' => array(TYPE_UINT, REQ_YES, null, array('includes/api_attachment.php', 'BugAPI')), + 'filename' => array(TYPE_STR, REQ_YES, 'verify_noempty'), + 'mimetype' => array(TYPE_STR, REQ_YES), + 'filesize' => array(TYPE_INT, REQ_NO), + 'attachment' => array(TYPE_NONE, REQ_YES), + 'description' => array(TYPE_STR, REQ_YES), + 'dateline' => array(TYPE_UINT, REQ_SET), + 'userid' => array(TYPE_UINT, REQ_YES, null, array('includes/api_user.php', 'UserAPI')) + ); + + /** + * Database table + * @var string + * @access private + */ + var $table = 'attachment'; + + /** + * Table prefix + * @var string + * @access private + */ + var $prefix = TABLE_PREFIX; + + // ################################################################### + /** + * Set field: dateline + * + * @access private + */ + function set_dateline() + { + $this->set('dateline', time()); + } +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.22.5