XBS_MODGEN
[ class tree: XBS_MODGEN ] [ index: XBS_MODGEN ] [ all elements ]

Class: xbs_modgen_BaseHandler

Source Location: /class/class.xbs_modgen.base.inc

Class Overview

XoopsObjectHandler
   |
   --xbs_modgen_BaseHandler

Object handler for xbs_modgen objects


Author(s):

Variables

Methods



Class Details

[line 704]
Object handler for xbs_modgen objects



Tags:

abstract:  


[ Top ]


Class Variables

$classname =

[line 711]

Set in descendent constructor to name of object that this handler handles


Type:   string


[ Top ]

$ins_tagname =

[line 716]

Set in ancestor to name of unique ID generator tag for use with insert function


Type:   string


[ Top ]



Class Methods


constructor xbs_modgen_BaseHandler [line 739]

xbs_modgen_BaseHandler xbs_modgen_BaseHandler( xoopsDatabase &$db)

Constructor



Parameters:

xoopsDatabase   &$db   handle for xoops database object

[ Top ]

method create [line 801]

object else &create( [mixed $isNew = true], boolean $isNew=true)

Create a new object

Relies on _create to create the actual object




Tags:

return:  False if failure


Parameters:

boolean   $isNew=true   create a new object and tell it is new. If False then create object but set it as not new

[ Top ]

method delete [line 973]

bool delete( xbs_modgenObject &$obj)

Delete object from the database



Tags:

return:  TRUE on success else False


Parameters:

xbs_modgenObject   &$obj   Object to delete

[ Top ]

method errno [line 759]

int errno( )

Return last error number



[ Top ]

method error [line 768]

string error( )

Return last error message



[ Top ]

method get [line 837]

object &get( int $id)

Get data for object given id.



Parameters:

int   $id   data item internal identifier

[ Top ]

method getError [line 777]

string getError( )

return last error number and message



[ Top ]

method getKey [line 871]

object of getKey( mixed 0)

Get internal identifier (primary key) based on user visible code

overide in ancestor to return the identifier




Tags:

return:  required type
abstract:  


Parameters:

mixed   0   Dependent on descendent class

[ Top ]

method insert [line 918]

bool insert( xbs_modgenObject &$obj)

Write an object back to the database

Overide in ancestor only if you need to add extra process before or after the insert.




Tags:

return:  True if successful


Parameters:

xbs_modgenObject   &$obj   reference to a xbs_modgen object

[ Top ]

method setError [line 749]

void setError( [mixed $errnum = 0], [mixed $errstr = ''], int $errnum=0, string $errstr='')

Set error information



Parameters:

int   $errnum=0   Error number
string   $errstr=''   Error Message

[ Top ]

method _create [line 788]

object or &_create( )

Must be overidden in ancestor to return a new object of the required kind



Tags:

return:  False if no object created
abstract:  


[ Top ]

method _delete [line 963]

string _delete( $cleanVars $cleanVars)

return SQL string to delete object from database

OVERIDE in ancestor to provide an UPDATE string for insert function Use the following construct inside your descendent to get data for the SQL string

  1. extract($cleanVars);




Tags:

return:  SQL string to update object data into database
abstract:  


Parameters:

$cleanVars   $cleanVars   array of key=>value pairs of data for insert string

[ Top ]

method _get [line 827]

string &_get( int $id)

Get data from the database and create a new object with it

Abstract method. Overide in ancestor and supply the sql string to get the data




Tags:

return:  SQL string to get data
abstract:  


Parameters:

int   $id   internal id of the object. Internal code is a unique int value.

[ Top ]

method _ins_insert [line 888]

string _ins_insert( $cleanVars $cleanVars)

OVERIDE in ancestor to provide an INSERT string for insert function

Use the following construct inside your descendent to get data for the SQL string

  1. extract($cleanVars);




Tags:

return:  SQL string to insert object data into database
abstract:  


Parameters:

$cleanVars   $cleanVars   array of key=>value pairs of data for insert string

[ Top ]

method _ins_update [line 904]

string _ins_update( $cleanVars $cleanVars)

OVERIDE in ancestor to provide an UPDATE string for insert function

Use the following construct inside your descendent to get data for the SQL string

  1. extract($cleanVars);




Tags:

return:  SQL string to update object data into database
abstract:  


Parameters:

$cleanVars   $cleanVars   array of key=>value pairs of data for insert string

[ Top ]


Documentation generated on Sun, 16 Jul 2006 11:02:44 +0100 by phpDocumentor 1.3.0RC3