CartoWeb3

# Class: WmsDatabase Source Location: /plugins/wmsBrowser/client/WmsDatabase.php
### Class Overview
| ### Constants DB_BBOX DB_CAPABILITIES DB_SERVER DB_STYLE | ### Methods dbaseAddRecord dbaseClose dbaseDeleteRecord dbaseOpen dbaseReplaceRecord deleteFile dropTable findMaxValue findRecord getDb getDbStructure getFileContent getRecordBy getRecordById listRecords openFile setValue
### Class Details [line 46] [ Top ] ### Class Methods ### method dbaseAddRecord [line 120]
`void dbaseAddRecord( integer $db, array $record)`
Adds the given data to the database #### Tags:
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
array | $record | indexed array of data. The number of items must be equal to the number of fields in the database
[ Top ] ### method dbaseClose [line 155]
`void dbaseClose( integer $db, [boolean $pack = true])`
Closes database #### Tags:
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
boolean | $pack | if true(default), pack database
[ Top ] ### method dbaseDeleteRecord [line 131]
`void dbaseDeleteRecord( integer $db, integer $dbRecId)`
Marks the given record to be deleted from the database. #### Tags:
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
integer | $dbRecId | record number
[ Top ] ### method dbaseOpen [line 107]
`database dbaseOpen( string $dbfFileName, integer $mode)`
Opens a dBase database with the given access mode. #### Tags:
return: | link identifier if the database is successfully opened, or false if an error occurred
access: | public
static: |
#### Parameters:
string | $dbfFileName | name of the dbf file
integer | $mode | access mode means read-only means write-only means read and write
[ Top ] ### method dbaseReplaceRecord [line 144]
`void dbaseReplaceRecord( integer $db, array $record, integer $dbRecId)`
Replaces the given record in the database with the given data. #### Tags:
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
array | $record | indexed array of data. The number of items must be equal to the number of fields in the database
integer | $dbRecId | record number
[ Top ] ### method deleteFile [line 57]
`void deleteFile( string $filePath)`
Deletes a file #### Tags:
access: | public
static: |
#### Parameters:
string | $filePath | file path
[ Top ] ### method dropTable [line 390]
`void dropTable( [string $tableName = ''])`
Delete all dbf tables if no parameter is specified, else delete only the table which name is specified. #### Tags:
access: | protected
static: |
#### Parameters:
string | $tableName | name of the dbf table to delete
[ Top ] ### method findMaxValue [line 369]
`integer findMaxValue( integer $db, string $field)`
Assumes a numeric field, will find the maximum value in that field of all records in the dbf file by scanning every line. Intended primarily for scanning ID fields. #### Tags:
return: | maximum value or false if it failed.
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
string | $field | name of the field to scan.
[ Top ] ### method findRecord [line 273]
`integer findRecord( integer $db, string $field, mixed $value)`
Search the database for a field containing a value #### Tags:
return: | the record number or false if not found
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
string | $field | field name to look it
mixed | $value | value to look for in the field
[ Top ] ### method getDb [line 167]
`link getDb( string $dbfFile)`
Open a database by filename and return a reference to it #### Tags:
return: | id for the database or false if the open failed.
access: | public
static: |
#### Parameters:
string | $dbfFile | name of the database to open
[ Top ] ### method getDbStructure [line 191]
`array getDbStructure( string $dbfFile)`
Retrieve table structure #### Tags:
return: | of table structure.
access: | protected
static: |
#### Parameters:
string | $dbfFile | the name of the database to retrieve structure
[ Top ] ### method getFileContent [line 89]
`array getFileContent( string $filePath)`
Reads entire file into an array #### Tags:
return: | or string
access: | public
static: |
#### Parameters:
string | $filePath | file path
[ Top ] ### method getRecordBy [line 336]
`array getRecordBy( integer $db, string $matchField, mixed $matchValue)`
Searchs the database for a field containing a value and return record #### Tags:
return: | matching record in the database
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
string | $matchField | name of the field to match
mixed | $matchValue | value to look for in the match field
[ Top ] ### method getRecordById [line 256]
`array getRecordById( integer $db, integer $id)`
Gets a record from a database as a trimmed associtive array #### Tags:
return: | database record
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
integer | $id | record index
[ Top ] ### method listRecords [line 297]
`array listRecords( integer $db, string $matchField, mixed $matchValue, string $extractField, [string $extraFilterField = ''], [mixed $extraFilterValue = ''])`
Searchs a database for a particular value in a particular field and returns an array of values from another field in matched records #### Tags:
return: | of values
access: | public
static: |
#### Parameters:
integer | $db | database identifier (must be open)
string | $matchField | name of the field to match
mixed | $matchValue | value to look for in the match field
string | $extractField | name of the field to return values from
string | $extraFilterField | name of the field to additionally match
mixed | $extraFilterValue | value to look for in the additional match field
[ Top ] ### method openFile [line 70]
`resource openFile( string $filePath, string $mode, [boolean $strict = true])`
Opens file or url #### Tags:
return: | a named ressource specified by filename to a stream
access: | public
static: |
#### Parameters:
string | $filePath | file or url path
string | $mode | type of access you require to the stream
boolean | $strict | if true (default), throws exception if open failed
[ Top ] ### method setValue [line 350]
`boolean setValue( integer $db, integer $dbRecId, string $key, mixed $value)`
Sets a key = value pair for the given record number in the given db. #### Tags:
return: | true if the update succeeded, false otherwise
access: | public
static: |
#### Parameters:
integer | $db | identifier for the database (must be open)
integer | $dbRecId | row number to set the key = value pair on
string | $key | field name to set
mixed | $value | value to set
[ Top ] ### Class Constants #### DB_BBOX = 'bbox.dbf' [line 50] [ Top ] #### DB_CAPABILITIES = 'capab.dbf' [line 49] [ Top ] #### DB_SERVER = 'server.dbf' [line 48] [ Top ] #### DB_STYLE = 'style.dbf' [line 51] [ Top ] Documentation generated on Mon, 16 Jul 2007 13:32:41 +0200 by phpDocumentor 1.3.0RC3