Class XDODataObjectDBRow

Description

Implements interfaces:

A helper for building dataobjects based on single RDBMS result rows

Whenever you have to build a dataobject which does just fetch the fields of a single database row this class can be used to achieve this easily.

You will have only have to provide the database (PDO) to be used, SQL queries for updating, inserting (actually two) and deleting the row, and a registration routine.

The appropiate parameters will be automatically bound to the statement created of this query.

  • abstract:
  • todo: Use Query-Builder when ready

Located in /phpsatk-lib/global/org.eenterphace.sat.xdo.dataobject.rdbms/xdo.dataobject.db.row.php (line 45)

XDODataObject
   |
   --XDODataObjectDBRow
Direct descendents
Class Description
roleXDO These are just tests and usage examples
XDOJob Job XDO
CACertInfo XDO - A certificate stored in the CA
AuthorizationRoleXDO XDO for managing a SAT Roles
AuthorizationUserXDO XDO for managing a SAT Users
AuthorizationACLEntryXDO XDO for managing ACL entries
AuthorizationACLEntryApplicationXDO Management XDO for application acl entries
AuthorizationACLEntryDataObjectXDO XDO for managing dataobject acl entries
Class Constant Summary
Variable Summary
PDO $conn
string $table
Method Summary
XDODataObjectDBRow create ([mixed $opt = null])
void delete ()
void fetch ()
void initialize ()
void prepare ()
void registerField (string $field, integer $type, integer $access, [boolean $index = false], [string $alias = null])
void update ()
Variables
PDO $conn (line 64)

Database connection to use

  • access: protected
string $table (line 71)

Database table to use

  • access: protected

Inherited Variables

Inherited from XDODataObject

XDODataObject::$fieldhint
Methods
create (line 266)

Creates/Inserts the database row

Does a insert of this objects values. Tries to determine the possibly new index value (e.g. in case of a auto incrementing primary key) by using the lastInserId method (which works for MySQL but might not for other RDBMS).

  • access: public
XDODataObjectDBRow create ([mixed $opt = null])
  • mixed $opt: Unused
delete (line 245)

Executes the delete query

Will be invoked when the remove() routine is called on this or some parent object. All properties of this object are accessible in the query as named parameters (":<propname>"). Will remove the complete row.

  • access: protected
void delete ()

Redefinition of:
XDODataObject::delete()
Deletes this object
fetch (line 108)

Handles the fetching of the row

  • access: public
void fetch ()

Redefinition of:
XDODataObject::fetch()
Fetches the properties of this object from the underlying storage
initialize (line 194)

Intitalizes the object

Initializes the connection - used 'xdo.rdbms.<objid>'

  • access: public
void initialize ()

Redefinition of:
XDODataObject::initialize()
Initialize the dataobject (stage2)
prepare (line 185)

Initializes an empty object

Not required here, but well ... php limitations

  • access: public
void prepare ()
registerField (line 90)

Registers a database field for usage

  • access: protected
void registerField (string $field, integer $type, integer $access, [boolean $index = false], [string $alias = null])
  • string $field: Field/Column name in database
  • integer $type: Field type (see constants in this class)
  • integer $access: Access allowed to this field (see XDOPropertyAccessTypes)
  • boolean $index: Whether this is the index column (uniqe)
  • string $alias: A alias name (will be used as attribute name)
update (line 209)

Executes the update query

Will update _ALL_ columns, so be careful when working with auto-updating date columns and/or triggers.

  • access: protected
void update ()

Redefinition of:
XDODataObject::update()
Puts the properties stored in this object to the underlying storage

Inherited Methods

Inherited From XDODataObject

XDODataObject::__construct()
XDODataObject::addChild()
XDODataObject::addChildren()
XDODataObject::commit()
XDODataObject::delete()
XDODataObject::exists()
XDODataObject::fetch()
XDODataObject::getChild()
XDODataObject::getChildren()
XDODataObject::getCollection()
XDODataObject::getFieldHint()
XDODataObject::getID()
XDODataObject::getItemID()
XDODataObject::getParent()
XDODataObject::getProperty()
XDODataObject::getPropertyAccess()
XDODataObject::hasChildren()
XDODataObject::initialize()
XDODataObject::pushEvent()
XDODataObject::register()
XDODataObject::registerProperty()
XDODataObject::remove()
XDODataObject::setDelegate()
XDODataObject::setParent()
XDODataObject::update()
XDODataObject::__get()
XDODataObject::__isset()
XDODataObject::__set()
Class Constants
TYPE_DATE = 3 (line 50)
TYPE_INT = 1 (line 48)
TYPE_STRING = 2 (line 49)

Documentation generated on Mon, 21 May 2007 10:35:27 +0200 by phpDocumentor 1.3.0RC5