©
本文档使用 PHP中文网手册 发布
The table below lists the currently provided SDO Data Access Services:
DAS Name | Description |
---|---|
SDO_DAS_XML | An XML Data Access Service supporting reading/writing SDOs as XML documents. |
SDO_DAS_Relational | A PDO-based Data Access Service supporting reading/writing SDO to relational databases. Implements an optimistic concurrency policy for updates. |
SDO consists of three sets of interfaces. The first set covers those interfaces for use by typical SDO applications. These are identified by the package prefix 'SDO_'. The second set is those used to reflect on, and work with, the model of a data object. These are identified by the package prefix 'SDO_Model_'. Finally, the third set are those use by Data Access Service implementations and are identified by the package prefix 'SDO_DAS_'. The majority of SDO users will not need to use or understand the 'SDO_Model_' and 'SDO_DAS_' interfaces.
The main interface through which data objects are manipulated. In addition to the methods below, SDO_DataObject extends the ArrayAccess, SDO_PropertyAccess (defines __get() / __set() methods for property access overloading), Iterator, and Countable interfaces.
getSequence - get the sequence for the data object
createDataObject - create a child data object
clear - unset the properties of a data object
getContainer - get the container (also known as 'parent') of this data object
getTypeName - get the name of the type for this data object
getTypeNamespaceURI - get the namespace URI of the type for this data object
The interface through which sequenced data objects can be accessed to preserve ordering across a data object's properties and to allow unstructured text. SDO_Sequence preserves contiguous indices and therefore inserting or removing elements may shift other elements up or down. In addition to the methods below, SDO_Sequence extends the ArrayAccess, Iterator and Countable interface.
getProperty - get the property for a given sequence index
move - move an element from one property index to another
insert - insert a new value into the sequence
The interface through which many-valued properties are manipulated. In addition to the method defined below, SDO_List extends ArrayAccess, Iterator and Countable. SDO_List preserves contiguous indices and therefore inserting or removing elements may shift other elements up or down.
insert - insert a new value into the list
The interface through which data objects can be created. A Data Access Service is responsible for populating the model (i.e. configuring the data factory with the type and structure information for the data objects it can create.) for the factory and can then optionally return an instance of, or implement, the SDO_DataFactory interface.
create - create a new data object
An SDO_Exception is thrown when the caller's request cannot be completed. The subclasses of SDO_Exception are:
SDO_PropertyNotSetException - the property specified exists but has not been set or does not have a default value
SDO_PropertyNotFoundException - the property specified is not part of the data object's type
SDO_TypeNotFoundException - the specified namespace URI or type name is unknown
SDO_InvalidConversionException - conversion between the types of the assignment is not possible
SDO_IndexOutOfBoundsException - the numeric index into a data object, sequence or list is not in the valid range
SDO_UnsupportedOperationException - the request cannot be completed because it is not allowed, for example an attempt to set a read-only property.
One method is added to those inherited from the built in Exception class:
getCause - get the cause of this SDO_Exception
The main interface used to reflect on a data object instance to obtain its model type and property information. It is designed to follow the reflection pattern introduced in PHP 5.
__construct - construct a new SDO_Model_ReflectionDataObject.
export - get a string describing the data object.
getType - get the SDO_Model_Type for the data object.
getInstanceProperties - get the instance properties of the data object.
getContainmentProperty - get the property which defines the containment relationship to the data object.
The interface through which a data object's type information can be retrieved. This interface can be used to find out the type name and namespace URI of the type, whether the type allow open content, and so on.
getName - get the name of the type.
getNamespaceURI - get the namespace URI of the type.
isInstance - test for a data object being an instance of the type.
getProperties - get the properties of the type.
getProperty - get a property of the type.
isDataType - test to see if this type is a primitive scalar type.
isSequencedType - test to see if this is a sequenced type.
isOpenType - test to see if this is an open type.
isAbstractType - test to see if this is an abstract type.
getBaseType - get the base type of this type (if one exists).
The interface through which a data object's property information can be retrieved. This interface can be used to find out the type of a property, whether a property has a default value, whether the property is contained or reference by its parent, its cardinality, and so on.
getName - get the name of the property.
getType - get the type of the property.
isMany - test to see if the property is many-valued.
isContainment - test to see if the property describes a containment relationship.
getContainingType - get the type which contains this property.
getDefault - get the default value for a property.
The interface through which a Data Access Service can access a data object's SDO_DAS_ChangeSummary. The change summary is used by the Data Access Service to check for conflicts when applying changes back to a data source.
getChangeSummary - get the change summary for a data object
The interface through which the change history of a data object is accessed. The change summary holds information for any modifications on a data object which occurred since logging was activated. In the case of deletions and modifications, the old values are also held in the change summary.
If logging is no longer active then the change summary only holds changes made up to the point when logging was deactivated. Reactivating logging clears the change summary. This is useful when a set of changes have been written out by a DAS and the data object is to be reused.
beginLogging - begin logging changes made to a data object
endLogging - end logging changes made to a data object
isLogging - test to see if change logging is on
getChangedDataObjects - get a list of the data objects which have been changed
getChangeType - get the type of change which has been made to a data object
getOldValues - get a list of old values for a data object
getOldContainer - get the old container data object for a deleted data object
The interface through which the old value for a property is accessed. A list of settings is returned by the change summary method getOldValues.
getPropertyIndex - get the property index for the changed property
getPropertyName - get the property name for the changed property
getValue - get the old value for the changed property
getListIndex - get the list index for the old value if it was part of a many-valued property
isSet - test to see if the property was set prior to being modified
The interface for constructing the model for an SDO_DataObject. The SDO_DAS_DataFactory is an abstract class providing a static method which returns a concrete data factory implementation. The implementation is used by Data Access Services to create an SDO model from their model. For example, a Relational Data Access Service might create and populate an SDO_DAS_DataFactory model based on a schema for a relational database.
getDataFactory - static methods for getting a concrete data factory instance
addType - add a new type to the SDO model
addPropertyToType - add a new property to a type definition in the SDO model
[#1] ng4rrjanbiah at rediffmail dot com [2006-03-17 22:07:50]
Some useful links on SDO:
1. Quick intro ( http://www.obalweb.net/wppro/?p=19 )
2. SDO for Zend Conf 2005 ( http://www.ibm.com/developerworks/forums/weblogs/data/SDOforZendConf2005.pdf ), Presentation, [481 KB], Graham Charters, 2005-10-18
3. Introducing Service Data Objects for PHP ( http://www.zend.com/pecl/tutorials/sdo.php ), 2005-08-05
4. Service Data Objects specification ( http://www.ibm.com/developerworks/library/specification/j-commonj-sdowmt/ ), 2003-2005
HTH,
R. Rajesh Jeba Anbiah