source: trunk/contactcenter/inc/class.so_prefix.inc.php @ 2

Revision 2, 2.9 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /***************************************************************************\
3  * eGroupWare - Contacts Center                                              *
4  * http://www.egroupware.org                                                 *
5  *                                                                           *
6  * Storage Object Classes                                                    *
7  * Written by:                                                               *
8  *  - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net>         *
9  *  sponsored by Thyamad - http://www.thyamad.com                            *
10  * ------------------------------------------------------------------------- *
11  *  This program is free software; you can redistribute it and/or modify it  *
12  *  under the terms of the GNU General Public License as published by the    *
13  *  Free Software Foundation; either version 2 of the License, or (at your   *
14  *  option) any later version.                                               *
15  \***************************************************************************/
16
17
18        include_once("class.so_main.inc.php");
19       
20        class so_prefix extends so_main
21        {
22       
23                function so_prefix ( $id = false )
24                {
25                        $this->init();
26                       
27                        $this->main_fields = array(
28                                'id_prefix' => array(
29                                        'name'  => 'id_prefix',
30                                        'type'  => 'primary',
31                                        'state' => 'empty',
32                                        'value' => &$this->id
33                                ),
34                                'prefix' => array(
35                                        'name'  => 'prefix',
36                                        'type'  => false,
37                                        'state' => 'empty',
38                                        'value' => false
39                                )
40                        );
41
42                        $this->db_tables = array(
43                                'phpgw_cc_prefixes' => array(
44                                        'type'   => 'main',
45                                        'keys'   => array(
46                                                'primary' => array(&$this->main_fields['id_prefix']),
47                                                'foreign' => false
48                                        ),
49                                        'fields' => & $this->main_fields
50                                )
51                        );
52                       
53                        if ($id)
54                        {
55                                $this->id = $id;
56                                if (!$this->checkout($id))
57                                {
58                                        $this->reset_values();
59                                        $this->state = 'new';
60                                }
61                        }
62                        else
63                        {
64                                $this->state = 'new';
65                        }
66                }
67       
68                /*********************************************************************\
69                 *                   Methods to Get Information                      *
70                \*********************************************************************/
71               
72                /*!
73               
74                        @function get_prefix
75                        @abstract Returns the Prefix
76                        @author Raphael Derosso Pereira
77               
78                */
79                function get_prefix (  )
80                {
81                        return $this->main_fields['prefix']['value'];
82                }
83       
84
85                /*********************************************************************\
86                 *                   Methods to Set Information                      *
87                \*********************************************************************/
88               
89                /*!
90               
91                        @function set_prefix
92                        @abstract Sets the Prefix
93                        @author Raphael Derosso Pereira
94                       
95                        @param string $prefix The Prefix
96               
97                */
98                function set_prefix ( $prefix )
99                {
100                        $this->main_fields['prefix']['value'] = $prefix;
101                        $this->manage_fields($this->main_fields['prefix']['value']);
102                }
103       
104        }
105?>
Note: See TracBrowser for help on using the repository browser.