[795] | 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 | |
---|
| 25 | class so_agent |
---|
| 26 | { |
---|
| 27 | //public functions |
---|
[2591] | 28 | |
---|
[795] | 29 | /** |
---|
| 30 | * @var array $public_functions Array of public functions |
---|
[2591] | 31 | * @access public |
---|
[795] | 32 | */ |
---|
| 33 | var $public_functions = array( |
---|
| 34 | 'read' => true, |
---|
| 35 | 'save' => true, |
---|
| 36 | ); |
---|
| 37 | /** |
---|
[2591] | 38 | * @var array $wf_table |
---|
[795] | 39 | * @access public |
---|
| 40 | */ |
---|
| 41 | var $wf_table = 'egw_wf_agent_'; |
---|
| 42 | /** |
---|
[2591] | 43 | * @var string $agent_table |
---|
[795] | 44 | * @access public |
---|
| 45 | */ |
---|
| 46 | var $agent_table = ''; |
---|
[2591] | 47 | |
---|
[795] | 48 | // link to the global db-object |
---|
[2591] | 49 | |
---|
[795] | 50 | /** |
---|
[2591] | 51 | * @var object $db objeto para conexao do banco de dados |
---|
[795] | 52 | * @access public |
---|
| 53 | */ |
---|
| 54 | var $db; |
---|
[2591] | 55 | |
---|
[795] | 56 | /** |
---|
| 57 | * Constructor of the so_agent class |
---|
| 58 | * do not forget to call it (parent::so_agent();) in child classes |
---|
| 59 | * @access public |
---|
[2591] | 60 | * @return object |
---|
[795] | 61 | */ |
---|
[2591] | 62 | |
---|
[795] | 63 | function so_agent() |
---|
| 64 | { |
---|
[2591] | 65 | $this->db =& Factory::getInstance('WorkflowObjects')->getDBGalaxia(); |
---|
[795] | 66 | } |
---|
[2591] | 67 | |
---|
[795] | 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 | } |
---|