[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/classes/ -> w2p.class.php (summary)

(no description)

Version: $Revision: 135 $
File Size: 519 lines (16 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CW2pObject:: (17 methods):
  CW2pObject()
  getError()
  bind()
  load()
  loadAll()
  getQuery()
  check()
  duplicate()
  w2PTrimAll()
  store()
  canDelete()
  delete()
  getDeniedRecords()
  getAllowedRecords()
  getAllowedSQL()
  setAllowedSQL()
  htmlDecode()


Class: CW2pObject  - X-Ref

CW2pObject Abstract Class.

Parent class to all database table derived objects
CW2pObject($table, $key)   X-Ref
Object constructor to set table and key field

Can be overloaded/supplemented by the child class
param: string $table name of the table in the db schema relating to child class
param: string $key name of the primary key field in the table

getError()   X-Ref

return: string Returns the error message

bind($hash)   X-Ref
Binds a named array/hash to this object

can be overloaded/supplemented by the child class
param: array $hash named array
return: null|string    null is operation was satisfactory, otherwise returns an error

load($oid = null, $strip = true)   X-Ref
Binds an array/hash to this object

param: int $oid optional argument, if not specifed then the value of current key is used
return: any result from the database operation

loadAll($order = null, $where = null)   X-Ref
Returns an array, keyed by the key field, of all elements that meet
the where clause provided. Ordered by $order key.


getQuery($alias = null)   X-Ref
Return a DBQuery object seeded with the table name.

param: string $alias optional alias for table queries.
return: DBQuery object

check()   X-Ref
Generic check method

Can be overloaded/supplemented by the child class
return: null if the object is ok

duplicate()   X-Ref
Clone the current record

author: handco <handco@users.sourceforge.net>
return: object    The new record object or null if error

w2PTrimAll()   X-Ref
Default trimming method for class variables of type string

param: object Object to trim class variables for
return: none

store($updateNulls = false)   X-Ref
Inserts a new row if id is zero or updates an existing row in the database table

Can be overloaded/supplemented by the child class
return: null|string null if successful otherwise returns and error message

canDelete(&$msg, $oid = null, $joins = null)   X-Ref
Generic check for whether dependencies exist for this object in the db schema

Can be overloaded/supplemented by the child class
param: string $msg Error message returned
param: int Optional key index
param: array Optional array to compiles standard joins: format [label=>'Label',name=>'table name',idfield=>'field',joinfield=>'field']
return: true|false

delete($oid = null)   X-Ref
Default delete method

Can be overloaded/supplemented by the child class
return: null|string null if successful otherwise returns and error message

getDeniedRecords($uid)   X-Ref
Get specifically denied records from a table/module based on a user

param: int User id number
return: array

getAllowedRecords($uid, $fields = '*', $orderby = '', $index = null, $extra = null, $table_alias = '')   X-Ref
Returns a list of records exposed to the user

param: int User id number
param: string Optional fields to be returned by the query, default is all
param: string Optional sort order for the query
param: string Optional name of field to index the returned array
param: array Optional array of additional sql parameters (from and where supported)
return: array

getAllowedSQL($uid, $index = null)   X-Ref
No description

setAllowedSQL($uid, &$query, $index = null, $key = null)   X-Ref
No description

htmlDecode()   X-Ref
No description



Generated: Sat Jul 17 03:00:04 2010 Cross-referenced by PHPXref 0.7