source: trunk/workflow/inc/class.so_agent.inc.php @ 795

Revision 795, 2.4 KB checked in by viani, 15 years ago (diff)

Ticket #488 - Inclusão do módulo workflow no ramo trunk do repositório Expresso.

  • Property svn:executable set to *
Line 
1<?php
2/**************************************************************************\
3* eGroupWare - Workflow Agent's SO-layer (storage-object)                  *
4* http://www.egroupware.org                                                *
5* (c) 2005 by Regis leroy <regis.leroy@glconseil.com>                      *
6* --------------------------------------------                             *
7*  This program is free software; you can redistribute it and/or modify it *
8*  under the terms of the GNU General Public License as published by the   *
9*  Free Software Foundation; either version 2 of the License, or (at your  *
10*  option) any later version.                                              *
11\**************************************************************************/
12
13
14/**
15 * Abstract Class to store/read all agents data
16 *
17 * Creation and deletion of agents records are done by the workflow engine, not
18 * by this class and her childs.
19 *
20 * @package Workflow
21 * @author regis.leroy@glconseil.com
22 * @license http://www.gnu.org/copyleft/gpl.html GPL
23 */
24
25class so_agent
26{
27        //public functions
28       
29        /**
30         * @var array $public_functions Array of public functions
31         * @access public
32         */
33        var $public_functions = array(
34                'read'  => true,
35                'save'  => true,
36        );
37        /**
38         * @var array $wf_table
39         * @access public
40         */
41        var $wf_table = 'egw_wf_agent_';
42        /**
43         * @var string $agent_table
44         * @access public
45         */
46        var $agent_table = '';
47       
48        // link to the global db-object
49       
50        /**
51         * @var object $db objeto para conexao do banco de dados
52         * @access public
53         */
54        var $db;
55       
56        /**
57         * Constructor of the so_agent class
58         * do not forget to call it (parent::so_agent();) in child classes
59         * @access public
60         * @return object
61         */
62       
63        function so_agent()
64        {
65                $this->db =& $GLOBALS['workflow']['workflowObjects']->getDBGalaxia();
66        }
67       
68        /**
69         * @abstract read all agent datas from the database
70         * @param int $agent_id int id of the entry to read
71         * @return array array/boolean array with column => value pairs or false if entry not found
72         */
73        function read($agent_id)
74        {
75                return false;
76        }
77
78        /**
79         * @abstract save all agent datas to the database
80         * @param int $agent_id int id of the entry to save
81         * @param array $datas is an array containing columns => value pairs which will be saved for this agent
82         * @return true if everything was ok, false else
83         */
84        function save($agent_id, &$datas)
85        {
86                return false;
87        }
88}
Note: See TracBrowser for help on using the repository browser.