MQdb::DBObject3pm
Description of object
Usage
Root class for all objects in MappedQuery toolkit
Overview
Root object for toolkit and all derived subclasses. All objects in the MappedQuery structure are designed to be persisted in a database. Here database is a more broad term and can be considered any object persistance systems. Currently the toolkit works with SQL based systems but object databases or custom storage engines are possible. Provides base common methods used by all objects.
Appendix
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Description: instance creation methodReturntype : instance of this Class (subclass)Exceptions : none
init
Description: initialization method which subclasses can extendReturntype : $selfExceptions : subclass dependent
copy
Description: Shallow copy which copies all base attributes of objectto new instance of same classReturntype : same as calling instanceExceptions : subclass dependent
class
Description: fixed string symbol for this class. Must be implementedfor each subclass and each subclass within toolkitshould return a unique name. used by global methods.Returntype : stringExceptions : error if subclass does not redefine
database
Description: the MQdb::Database where this object is permanently persisted to.Here database is any object persistance system.Returntype : MQdb::DatabaseExceptions : die if invalid setter value type is provided
primary_id
Description: the unique identifier for this object within database.Returntype : scalar or UNDEFExceptions : none
id
Description: the unique identifier for this object within database.Returns empty string if not persisted.Returntype : scalar or ''Exceptions : none
db_id
Description: the worldwide unique identifier for this object.A URL-like combination of database, class, and idReturntype : string or undef if database is not definedExceptions : none
display_desc
Description: general purpose debugging method that returns a nicehuman readable description of the object instance contents.Each subclass should implement and return a nice string.Returntype : string scalarExceptions : none
display_info
Description: convenience method which prints the display_desc stringwith a carriage return to STDOUT. useful for debugging.Returntype : noneExceptions : none
xml
Description: every object in system should be persistable in XML format.returns an XML description of the object and all child objects.Each subclass must implement and return a proper XML string.Best if one implements xml_start() and xml_end() and use here.Returntype : string scalarExceptions : noneDefault : default is a simple xml_start + xml_end
xml_start
Description: every object in system should be persistable in XML format.returns an XML description of the object and all child objects.Each subclass should OVERRIDE this method and return a proper XML string.xml_start is the primary XML start tagExample : return sprintf("<feature id='%d' name='%d' ..... >", $id, $name....);Returntype : string scalarExceptions : none
xml_end
Description: every object in system should be persistable in XML format.returns an XML description of the object and all child objects.Each subclass should OVERRIDE this method and return a proper XML string.xml_end is the primary XML end tagExample : return "</feature>";Returntype : string scalarExceptions : none
simple_xml
Description: short hand for xml_start() . xml_end()Can be used when only the primary XML start tag and attributes are neededNo need to override if xml_start() and xml_end() are implementedReturntype : string scalarExceptions : none
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 2 times.