| applications_indexedlistmanager

# Class: Bs_IndexedListManager Source Location: /applications/indexedlistmanager/Bs_IndexedListManager.class.php
### Class Overview
    Bs_Object
       |
       --Bs_IndexedListManager
Indexed List Manager. Frontend for a key=>value list (hashtable) coming from a db. #### Author(s): andrej arn <at blueshoes dot org> #### Version: 4.4.$Revision: 1.3 $ $Date: 2003/08/27 17:44:09 $ #### Copyright: blueshoes.org | ### Variables $fieldNameKey $fieldNameValue $maxLength $minLength $tableName $unique | ### Methods Bs_IndexedListManager add checkDb checkValue delete edit getList renderPage setDb _renderBody _renderHead
### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 18] Indexed List Manager. Frontend for a key=>value list (hashtable) coming from a db. Uses MySQL and JSRS. dependencies: #### Tags:
copyright: | blueshoes.org
since: | bs4.5
access: | public
version: | 4.4.$Revision: 1.3 $ $Date: 2003/08/27 17:44:09 $
author: | andrej arn <at blueshoes dot org>
[ Top ] ### Class Variables #### $fieldNameKey = 'ID' [line 29] #### Tags:
access: | public
Type: | mixed
[ Top ] #### $fieldNameValue = 'caption' [line 34] #### Tags:
access: | public
Type: | mixed
[ Top ] #### $maxLength = 255 [line 56] #### Tags:
access: | public
Type: | mixed
[ Top ] #### $minLength = 1 [line 51] #### Tags:
access: | public
Type: | mixed
[ Top ] #### $tableName = [line 24] #### Tags:
access: | public
Type: | mixed
[ Top ] #### $unique = 2 [line 46] if values must be unique. = no. = yes, case sensitive ("foo" and "FOO" are allowed). = yes, case insensitive (if "foo" exists "FOO" is rejected). #### Tags:
access: | public
Type: | int
[ Top ] ### Class Methods ### constructor Bs_IndexedListManager [line 70]
`Bs_IndexedListManager Bs_IndexedListManager( )`
constructor [ Top ] ### method add [line 101]
`array add( string $value)`
adds the given value to the list. return value: hash with the keys 'key' => string (probably numeric), the new key (ID) of the new value, if added. 'value' => string, the elements caption that should have been added. 'status' => bool, if it was successful. 'error' => string, error message if status is false. #### Tags:
return: | (see above)
access: | public
#### Parameters:
string | $value |
[ Top ] ### method checkDb [line 241]
`bool checkDb( )`
checks the db, table, fields, creates the table if needed. #### Tags:
return: | TRUE
throws: | string (error message)
access: | public
[ Top ] ### method checkValue [line 223]
`bool checkValue( string $val)`
#### Tags:
return: | TRUE
throws: | string (error message)
access: | public
#### Parameters:
string | $val |
[ Top ] ### method delete [line 180]
`array delete( mixed $key)`
deletes the record with the given $key. return value: hash with the keys 'key' => string (probably numeric), the key (ID) of the record. 'status' => bool, if it was successful. 'error' => string, error message if status is false. #### Tags:
return: | (see above)
access: | public
#### Parameters:
mixed | $key | (probably a numeric string)
[ Top ] ### method edit [line 139]
`array edit( mixed $key, string $newValue)`
edits the record with the given $key and sets the $newValue. return value: hash with the keys 'key' => string (probably numeric), the key (ID) of the record. 'value' => string, the elements new caption. 'status' => bool, if it was successful. 'error' => string, error message if status is false. #### Tags:
return: | (see above)
access: | public
#### Parameters:
mixed | $key | (probably a numeric string)
string | $newValue |
[ Top ] ### method getList [line 209]
`array getList( )`
returns the full list as hash. #### Tags:
return: | (hash)
access: | public
[ Top ] ### method renderPage [line 268]
`string renderPage( string $serverUrl, [mixed $addScript = ''])`
renders the page and returns it. #### Tags:
return: | (html code)
access: | public
#### Parameters:
string | $serverUrl | (url to the communicator php script.)
[ Top ] ### method setDb [line 82]
`void setDb( object $dbObj)`
if you don't wanna use the global db, set one here. #### Tags:
access: | public
#### Parameters:
object | $dbObj | (pass it by ref if you can)
[ Top ] ### method _renderBody [line 289]
`string _renderBody( )`
#### Tags:
return: | (html code)
access: | public
[ Top ] ### method _renderHead [line 337]
`string _renderHead( )`
#### Tags:
return: | (html code)
access: | public
[ Top ] Documentation generated on Mon, 29 Dec 2003 21:11:18 +0100 by phpDocumentor 1.2.3