scripts.carrubbers.org home scripts@carrubbers.org
*

genericdb.php Documentation

Documentation for the genericdb.php file version 2.1

Contents


Introduction

genericdb.php by Nigel Swinson.

+================================================================================================+
| The intention is that you use this class as a base class, set the
| DbFileName, TableName, RecordName, and then just start using the db.
| The Open() wrapper will take care of working out if the db needs to be
| opened, and if so which type.  It can also be called multiple times and
| it will work out if it must re-open the database with more access permissions
| or if the previous open will suffice.
|
| The Search() method will use the TableName and RecordName that you have set
| giving you more convenient access to searching.
+================================================================================================+
| Copyright:
|
| genericdb.php: Utility access to a db table following the CXmlDb API
|
| Copyright (C) 2003 Nigel Swinson, nigelswinson@users.sourceforge.net
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of the GNU General Public License
| as published by the Free Software Foundation; either version 2
| of the License, or (at your option) any later version.
|
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License
| along with this program; if not, write to the Free Software
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+================================================================================================+

Class CGenericDb

Public Methods

Public Method Detail

Method Details: CGenericDb



function CGenericDb()

Constructor

Line:

Defined on line 81

Method Details: SetOptions



function SetOptions($aOptions)

A wrapper for SetOptions(), operating on the default table and record

Line:

Defined on line 87

Method Details: SetPermission



function SetPermission($Name, $Value)

Set a permission

Permissions need to be remembered, and passed into the potentially open db

Parameter:

string $Name

The name of the permission

int $Value

One of the XMLDB_PERMISSION_ENABLE permissions

Line:

Defined on line 104

Method Details: UnSetPermission



function UnSetPermission($Name)

UnSet a permission

Permissions need to be remembered, and passed into the potentially open db

Parameter:

string $Name

The name of the permission

Line:

Defined on line 118

Method Details: Open



function Open($bWriteAccess = FALSE)

A wrapper for opening the database

You can specify if you want write access.  You can call this function
multiple times.

Parameter:

bool $bWriteAccess

Whether or not we need write access to the db

Return Value:

bool

TRUE on success, FALSE on failure. The function logs it's own errors.

Line:

Defined on line 135

Method Details: Close



function Close()

A wrapper for closing the database

Return Value:

bool

TRUE on success, FALSE on failure.

Line:

Defined on line 220

Method Details: GetTableNames



function GetTableNames()

A wrapper for GetTableNames()

Line:

Defined on line 233

Method Details: GetRecordNames



function GetRecordNames()

A wrapper for GetFieldNames(), operating on the default table

Line:

Defined on line 243

Method Details: GetFieldNames



function GetFieldNames()

A wrapper for GetFieldNames(), operating on the default table and record

Line:

Defined on line 253

Method Details: GetSchema



function GetSchema()

A wrapper for GetSchema(), operating on the default table and record

Line:

Defined on line 265

Method Details: AddRecord



function AddRecord($aElementData)

A wrapper for AddRecord(), operating on the default table and record

Line:

Defined on line 277

Method Details: AddUniqueRecord



function AddUniqueRecord($aElementData, $XPathSearch)

A wrapper for AddUniqueRecord(), operating on the default table and record

Line:

Defined on line 290

Method Details: ModifyRecord



function ModifyRecord($RecordId, $aElementData, $bPreserveContent = FALSE)

A wrapper for ModifyRecord(), operating on the default table and record

Line:

Defined on line 304

Method Details: RemoveRecord



function RemoveRecord($XPathSearch)

A wrapper for RemoveRecord(), operating on the default table and record

Line:

Defined on line 319

Method Details: RemoveRecordId



function RemoveRecordId($aRecordIds)

A wrapper for RemoveRecordId(), operating on the default table and record

Line:

Defined on line 332



function Search($XPathSearch)

A wrapper for Search(), operating on the default table and record

Line:

Defined on line 345

Method Details: SortSearch



function SortSearch($aSearchResults, $SortByKey = 0, $bReverseSortOrder = FALSE)

A wrapper for SortSearch()

Line:

Defined on line 358

Method Details: Display



function Display($aSearchResults, $FunctionName, $aFunctionParameters, $bTestFlag = FALSE)

A wrapper for Display()

Line:

Defined on line 368

Method Details: SearchAndDisplay



function SearchAndDisplay($XPathSearch, $FunctionName, $aFunctionParameters)

A wrapper for SearchAndDisplay(), operating on the default table and record

Line:

Defined on line 378


Last updated: 17 April 2008 02:15:13.

© 2008 Carrubbers Christian Centre | Registered Charity No. SC011455
Conditions of Use | Privacy Policy