Fix DB_MySQL_PDO::escape_binary().
[bugdar.git] / includes / api_priority.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright (c)2002-2007 Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 $GLOBALS['isso:callback']->load('api', null);
23
24 require_once('./includes/functions_datastore.php');
25
26 /**
27 * API: Priority
28 *
29 * @author Blue Static
30 * @copyright Copyright (c)2002 - 2007, Blue Static
31 * @version $Revision$
32 * @package Bugdar
33 *
34 */
35 class PriorityAPI extends API
36 {
37 /**
38 * Fields
39 * @var array
40 * @access private
41 */
42 var $fields = array(
43 'priorityid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'),
44 'priority' => array(TYPE_STR, REQ_YES, 'verify_noempty'),
45 'displayorder' => array(TYPE_INT, REQ_NO)
46 );
47
48 /**
49 * Database table
50 * @var string
51 * @access private
52 */
53 var $table = 'priority';
54
55 /**
56 * Table prefix
57 * @var string
58 * @access private
59 */
60 var $prefix = TABLE_PREFIX;
61
62 // ###################################################################
63 /**
64 * Post-insert
65 *
66 * @access protected
67 */
68 function post_insert()
69 {
70 build_priorities();
71 }
72
73 // ###################################################################
74 /**
75 * Post-update
76 *
77 * @access protected
78 */
79 function post_update()
80 {
81 build_priorities();
82 }
83
84 // ###################################################################
85 /**
86 * Post-delete
87 *
88 * @access protected
89 */
90 function post_delete()
91 {
92 build_priorities();
93 $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . $this->registry->options['defaultpriority'] . " WHERE priority = " . $this->values['priorityid']);
94 }
95 }
96