| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | /********************************************************************\ |
|---|
| 5 | * This program is free software; you can redistribute it and/or * |
|---|
| 6 | * modify it under the terms of the GNU General Public License as * |
|---|
| 7 | * published by the Free Software Foundation; either version 2 of * |
|---|
| 8 | * the License, or (at your option) any later version. * |
|---|
| 9 | * * |
|---|
| 10 | * This program is distributed in the hope that it will be useful, * |
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
|---|
| 13 | * GNU General Public License for more details. * |
|---|
| 14 | * * |
|---|
| 15 | * You should have received a copy of the GNU General Public License* |
|---|
| 16 | * along with this program; if not, contact: * |
|---|
| 17 | * * |
|---|
| 18 | * Free Software Foundation Voice: +1-617-542-5942 * |
|---|
| 19 | * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * |
|---|
| 20 | * Boston, MA 02111-1307, USA gnu@gnu.org * |
|---|
| 21 | * * |
|---|
| 22 | \********************************************************************/ |
|---|
| 23 | /**@file GenericObject.php |
|---|
| 24 | * @author Copyright (C) 2005 Benoit Grégoire <bock@step.polymtl.ca>, |
|---|
| 25 | * Technologies Coeus inc. |
|---|
| 26 | */ |
|---|
| 27 | require_once BASEPATH.'include/common.php'; |
|---|
| 28 | require_once BASEPATH.'classes/Content.php'; |
|---|
| 29 | |
|---|
| 30 | /** Any object that implement this interface can be administered in a generic way. */ |
|---|
| 31 | interface GenericObject |
|---|
| 32 | { |
|---|
| 33 | /** Get an instance of the object |
|---|
| 34 | * @see GenericObject |
|---|
| 35 | * @param $id The object id |
|---|
| 36 | * @return the Content object, or null if there was an error (an exception is also thrown) |
|---|
| 37 | */ |
|---|
| 38 | static public function getObject($id); |
|---|
| 39 | /** Create a new Content object in the database |
|---|
| 40 | * @see GenericObject |
|---|
| 41 | * @return the newly created object, or null if there was an error |
|---|
| 42 | */ |
|---|
| 43 | static function createNewObject(); |
|---|
| 44 | |
|---|
| 45 | /** Retreives the id of the object |
|---|
| 46 | * @return The id, a string */ |
|---|
| 47 | public function getId(); |
|---|
| 48 | |
|---|
| 49 | /** Retreives the admin interface of this object. |
|---|
| 50 | * @return The HTML fragment for this interface */ |
|---|
| 51 | public function getAdminUI(); |
|---|
| 52 | |
|---|
| 53 | /** Process admin interface of this object. |
|---|
| 54 | */ |
|---|
| 55 | public function processAdminUI(); |
|---|
| 56 | |
|---|
| 57 | /** Delete this Object form it's storage mechanism |
|---|
| 58 | * @param &$errmsg Returns an explanation of the error on failure |
|---|
| 59 | * @return true on success, false on failure or access denied */ |
|---|
| 60 | public function delete(& $errmsg); |
|---|
| 61 | |
|---|
| 62 | } // End interface |
|---|
| 63 | ?> |
|---|