3
* $RCSfile: GalleryToolkitPropertyMap.inc,v $
5
* Gallery - a web based photo album viewer and editor
6
* Copyright (C) 2000-2005 Bharat Mediratta
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or (at
11
* your option) any later version.
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
23
* @package GalleryCore
24
* @subpackage ClassInterfaces
25
* @version $Revision: 1.19 $ $Date: 2005/08/23 03:49:04 $
26
* @author Bharat Mediratta <bharat@menalto.com>
30
* Interface class for the GalleryToolkitPropertyMap class.
31
* (Class schema version: 1.0)
33
* This file is automatically generated from XML embedded in the
34
* class, combined with the ClassCode.xsl file. You should not modify
35
* it by hand, as your changes will be lost next time this file is
36
* rebuilt. If you want to add more getters/setters, you should add
37
* them in the core class. If you want to change the format of this
38
* file, then you should edit the XSL template.
40
* @package GalleryCore
43
class GalleryToolkitPropertyMap extends GalleryToolkitPropertyMap_core {
46
* Return the name of this class with the proper mix of uppercase and
47
* lowercase (get_class() always returns lowercase)
49
* @return string class name
51
function getClassName() {
52
return 'GalleryToolkitPropertyMap';
56
* Return the path to the PHP file for this class, relative to the gallery2 dir
60
function getClassFile() {
62
basename(dirname(dirname(dirname(__FILE__)))) .
63
'/classes/GalleryToolkitPropertyMap.class';
67
* Get meta information about this class' map
69
* @return array map member => type
71
function getMapInfo() {
73
$info['members']['name'] = STORAGE_TYPE_STRING;
74
$info['members']['type'] = STORAGE_TYPE_STRING;
75
$info['members']['description'] = STORAGE_TYPE_STRING;
80
* Add an entry to this map
82
* @param array an associative array of the entry data
83
* @return object GalleryStatus a status code
86
function addMapEntry($data) {
88
foreach (array('name', 'type', 'description', ) as $key) {
89
if (!array_key_exists($key, $data)) {
90
return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__,
91
'Missing parameter: ' . $key);
95
$storage =& $gallery->getStorage();
96
$ret = $storage->addMapEntry('GalleryToolkitPropertyMap', $data);
97
if ($ret->isError()) {
98
return $ret->wrap(__FILE__, __LINE__);
100
return GalleryStatus::success();
104
* Remove an entry from this map
106
* @param array an associative array of the entry data to match and remove
107
* @return object GalleryStatus a status code
110
function removeMapEntry($data) {
113
if (sizeof($data) == 0) {
114
return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
117
$storage =& $gallery->getStorage();
118
$ret = $storage->removeMapEntry('GalleryToolkitPropertyMap', $data);
119
if ($ret->isError()) {
120
return $ret->wrap(__FILE__, __LINE__);
122
return GalleryStatus::success();
126
* Remove ALL entries from this map.. use with caution!
128
* @return object GalleryStatus a status code
131
function removeAllMapEntries() {
134
$storage =& $gallery->getStorage();
135
$ret = $storage->removeAllMapEntries('GalleryToolkitPropertyMap');
136
if ($ret->isError()) {
137
return $ret->wrap(__FILE__, __LINE__);
139
return GalleryStatus::success();
143
* Update an entry in this map
145
* @param array the entry to match
146
* @param array the values to change
147
* @return object GalleryStatus a status code
150
function updateMapEntry($match, $change) {
153
if (sizeof($match) == 0 || sizeof($change) == 0) {
154
return GalleryStatus::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__);
157
$storage =& $gallery->getStorage();
158
$ret = $storage->updateMapEntry('GalleryToolkitPropertyMap', $match, $change);
159
if ($ret->isError()) {
160
return $ret->wrap(__FILE__, __LINE__);
162
return GalleryStatus::success();