Public Member Functions | Protected Member Functions | Protected Attributes

WobTable Class Reference

parent class of all tables More...

Inheritance diagram for WobTable:
BarcodeTable WTaddress WTartist WTcart WTcartitem WTcartticket WTcartvoucher WTconfig WTcontact WTcontacttype WTcountry WTcustomer WTdocumentlog WTevent WTeventprice WThost WTitem WTitem_audit WTorder WTorder_audit WTpaymenttype WTpricecategory WTproduct WTrole WTroleright WTroom WTseatplan WTsession WTshipping WTtemplate WTticket_audit WTuser WTuserhost WTuserrole WTvoucher_audit WTwebsession

List of all members.

Public Member Functions

 __get ($name)
 returns the property/column
 __isset ($name)
 checks whether a column exists
 __set ($name, $value)
 set properties
 __unset ($name)
 unsets column-properties to NULL
 deleteFromDb ()
 deletes this instance from the database; returns true if it actually executed
 hasColumn ($c)
 returns whether the table contains a specific column
 hasProperty ($c)
 overridden by woc, returns true if the property exists
 insert ()
 insert the object under a new primary key value into the DB (implicitly calls newKey); returns true on success
 insertOrUpdate ()
 updates existing object in the database or inserts it if it does not exist in the DB yet
 isAuditable ()
 returns whether this is an auditable table
 isChanged ()
 returns whether any property has changed since the last DB sync
 isColumnChanged ($c)
 returns whether a specific column has changed since the last DB sync
 newKey ()
 generate a new primary key value for insert and marks the object as not yet in the DB; the default sets the primary key to NULL if it is a sequence; call the original first if you overwrite it
 revert ($name)
 reverts changes to the property
 revertAll ()
 reverts all changes to properties
 setFromArray (array $data)
 set multiple properties
 tableName ()
 returns the name of the table
 update ()
 updates the object in the database; returns true on success; fails if it did not come from the DB - use insertOrUpdate in this case; succeeds without asking the database if nothing has changed
 where ()
 returns the where clause to find this instance (via primary key columns)

Protected Member Functions

 __construct (array $data, $isfromdb, $table)
 constructs a basic table
 createAudit ()
 overridden by woc, if this an auditable table; used in insert and update
 resetAudit ()
 overridden in auditable implementations: resets the audit state

Protected Attributes

 $cdata
 $data

Detailed Description

parent class of all tables


Constructor & Destructor Documentation

WobTable::__construct ( array $  data,
isfromdb,
table 
) [protected]

constructs a basic table

References $d, hasProperty(), and resetAudit().


Member Function Documentation

WobTable::__get ( name  ) 

returns the property/column

References hasProperty().

WobTable::__isset ( name  ) 

checks whether a column exists

References $db.

WobTable::__set ( name,
value 
)

set properties

References hasProperty().

Referenced by setFromArray().

WobTable::__unset ( name  ) 

unsets column-properties to NULL

References $dbScheme, and hasProperty().

WobTable::createAudit (  )  [protected]

overridden by woc, if this an auditable table; used in insert and update

Reimplemented in WTitem, WTorder, WTticket, and WTvoucher.

Referenced by insert(), and update().

WobTable::deleteFromDb (  ) 

deletes this instance from the database; returns true if it actually executed

References $db, isAuditable(), resetAudit(), and where().

WobTable::hasColumn ( c  ) 

returns whether the table contains a specific column

References $dbScheme.

WobTable::insert (  ) 

insert the object under a new primary key value into the DB (implicitly calls newKey); returns true on success

References $d, $data, $db, $dbScheme, createAudit(), and newKey().

Referenced by insertOrUpdate().

WobTable::insertOrUpdate (  ) 

updates existing object in the database or inserts it if it does not exist in the DB yet

References insert(), and update().

WobTable::isAuditable (  ) 

returns whether this is an auditable table

Reimplemented in WTitem, WTorder, WTticket, and WTvoucher.

Referenced by deleteFromDb().

WobTable::isChanged (  ) 

returns whether any property has changed since the last DB sync

WobTable::isColumnChanged ( c  ) 

returns whether a specific column has changed since the last DB sync

WobTable::newKey (  ) 

generate a new primary key value for insert and marks the object as not yet in the DB; the default sets the primary key to NULL if it is a sequence; call the original first if you overwrite it

Reimplemented in WTaddress, WTartist, WTcart, WTcartitem, WTcartticket, WTcartvoucher, WTconfig, WTcontact, WTcontacttype, WTcountry, WTcustomer, WTdocumentlog, WTevent, WTeventprice, WThost, WTitem, WTitem_audit, WTorder, WTorder_audit, WTpaymenttype, WTpricecategory, WTproduct, WTrole, WTroleright, WTroom, WTseatplan, WTsession, WTshipping, WTtemplate, WTticket, WTticket_audit, WTuser, WTuserhost, WTuserrole, WTvoucher, WTvoucher_audit, and WTwebsession.

References $dbScheme, and resetAudit().

Referenced by insert().

WobTable::resetAudit (  )  [protected]

overridden in auditable implementations: resets the audit state

Reimplemented in WTitem, WTorder, WTticket, and WTvoucher.

Referenced by __construct(), deleteFromDb(), and newKey().

WobTable::revert ( name  ) 

reverts changes to the property

References hasProperty().

WobTable::revertAll (  ) 

reverts all changes to properties

WobTable::setFromArray ( array $  data  ) 

set multiple properties

References __set(), and hasProperty().

WobTable::tableName (  ) 

returns the name of the table

WobTable::update (  ) 

updates the object in the database; returns true on success; fails if it did not come from the DB - use insertOrUpdate in this case; succeeds without asking the database if nothing has changed

References $d, $db, createAudit(), and where().

Referenced by insertOrUpdate().

WobTable::where (  ) 

returns the where clause to find this instance (via primary key columns)

References $db, and $dbScheme.

Referenced by deleteFromDb(), and update().


Member Data Documentation

WobTable::$cdata [protected]

The documentation for this class was generated from the following file: