3 * FusionForge file release system
5 * Copyright 2007 SoftwareEntwicklung Beratung Schulung
6 * Copyright 2007 Karl Heinz Marbaise
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once $gfcommon.'include/Error.class.php';
26 function get_frs_fileprocessortypes() {
27 $res=db_query_params('SELECT * FROM frs_processor', array());
28 if (db_numrows($res) < 1) {
32 while($arr = db_fetch_array($res)) {
33 $ps[]=new FRSFileProcessorType($arr['processor_id'],$arr['name']);
38 class FRSFileProcessorType extends Error {
41 * Associative array of data from db.
43 * @var array $data_array.
47 function FRSFileProcessorType($processor_id, $name) {
49 $this->data_array = array( 'processor_id' => $processor_id, 'name' => $name);
53 * fetchData - re-fetch the data for this FRSFileType from the database.
55 * @param int The type_id
56 * @return boolean success.
58 function fetchData($processor_id) {
59 $res=db_query_params('SELECT * FROM frs_processor WHERE processor_id=$1', array($processor_id));
60 if (!$res || db_numrows($res) < 1) {
61 $this->setError('FRSFileType::fetchData() Invalid type_id');
64 $this->data_array = db_fetch_array($res);
70 * getID - get this file_id.
72 * @return int The id of this file.
75 return $this->data_array['processor_id'];
79 * getName - get the name of this file.
81 * @return string The name of this file.
84 return $this->data_array['name'];