<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >SDO_DAS_DataFactory::addPropertyToType</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="SDO Functions" HREF="ref.sdo.html"><LINK REL="PREVIOUS" TITLE="SDO_DAS_ChangeSummary::isLogging" HREF="function.sdo-das-changesummary-islogging.html"><LINK REL="NEXT" TITLE="SDO_DAS_DataFactory::addType" HREF="function.sdo-das-datafactory-addtype.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.sdo-das-changesummary-islogging.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.sdo-das-datafactory-addtype.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.SDO-DAS-DataFactory-addPropertyToType" ></A >SDO_DAS_DataFactory::addPropertyToType</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN202801" ></A ><P > (no version information, might be only in CVS)</P >SDO_DAS_DataFactory::addPropertyToType -- Adds a property to a type </DIV ><DIV CLASS="refsect1" ><A NAME="AEN202804" ></A ><H2 >说明</H2 >void <B CLASS="methodname" >SDO_DAS_DataFactory::addPropertyToType</B > ( string parent_type_namespace_uri, string parent_type_name, string property_name, string type_namespace_uri, string type_name [, array options] )<BR ></BR ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >警告</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >本函数是<SPAN CLASS="emphasis" ><I CLASS="emphasis" >实验性</I ></SPAN >的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本函数风险自担。</P ></TD ></TR ></TABLE ></DIV ><P > Adds a property to a type. The type must already be known to the SDO_DAS_DataFactory (i.e. have been added using addType()). The property becomes a property of the type. This is how the graph model for the structure of an SDO_DataObject is built. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN202831" ></A ><H2 >参数</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >parent_type_namespace_uri</CODE ></DT ><DD ><P > The namespace URI for the parent type. </P ></DD ><DT ><CODE CLASS="parameter" >parent_type_name</CODE ></DT ><DD ><P > The type name for the parent type. </P ></DD ><DT ><CODE CLASS="parameter" >property_name</CODE ></DT ><DD ><P > The name by which the property will be known in the parent type. </P ></DD ><DT ><CODE CLASS="parameter" >type_namespace_uri</CODE ></DT ><DD ><P > The namespace URI for the type of the property. </P ></DD ><DT ><CODE CLASS="parameter" >type_name</CODE ></DT ><DD ><P > The type name for the type of the property </P ></DD ><DT ><CODE CLASS="parameter" >options</CODE ></DT ><DD ><P > This array holds one or more key=>value pairs to set attribute values for the property. The optional keywords are:</P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >many</CODE ></DT ><DD ><P >A flag to say whether the property is many-valued. A value of 'true' adds the property as a many-valued property (default is 'false'). </P ></DD ><DT ><CODE CLASS="parameter" >readOnly</CODE ></DT ><DD ><P > A flag to say whether the property is read-only. A value of 'true' means the property value cannot be modified through the SDO application APIs (default is 'false'). </P ></DD ><DT ><CODE CLASS="parameter" >containment</CODE ></DT ><DD ><P > A flag to say whether the property is contained by the parent. A value of 'true' means the property is contained by the parent. A value of 'false' results in a non-containment reference (default is 'true'). This flag is only interpreted when adding properties which are data object types, otherwise it is ignored. </P ></DD ><DT ><CODE CLASS="parameter" >default</CODE ></DT ><DD ><P > A default value for the property. Omitting this key means that the property does not have a default value. A property can only have a default value if it is a single-valued data type (primitive). </P ></DD ></DL ></DIV ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN202886" ></A ><H2 >返回值</H2 ><P > None. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN202889" ></A ><H2 >更新日志</H2 ><P > <DIV CLASS="informaltable" ><P ></P ><A NAME="AEN202892" ></A ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >版本</TH ><TH >说明</TH ></TR ></THEAD ><TBODY ><TR ><TD >0.5.2</TD ><TD >Optional parameters <CODE CLASS="varname" >many</CODE >, <CODE CLASS="varname" >readOnly</CODE >, and <CODE CLASS="varname" >containment</CODE > deprecated in favour of the <CODE CLASS="varname" >options</CODE > array. </TD ></TR ></TBODY ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN202906" ></A ><H2 >范例</H2 ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN202909" ></A ><P ><B >例 1. A <B CLASS="function" >SDO_DAS_DataFactory::addPropertyToType()</B > example</B ></P ><P > The following adds an 'addressline' property to a Person type. The person type is identified by its namespace, 'PersonNS', and type name, 'PersonType'. The type of the 'addressline' property is a many-valued SDO data type (primitive) with namespace 'commonj.sdo' and type name 'String'. </P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /> $df</font><font color="#007700">-></font><font color="#0000BB">addPropertyToType</font><font color="#007700">(</font><font color="#DD0000">'PersonNS'</font><font color="#007700">, </font><font color="#DD0000">'PersonType'</font><font color="#007700">,<br /> </font><font color="#DD0000">'addressline'</font><font color="#007700">, </font><font color="#DD0000">'commonj.sdo'</font><font color="#007700">, </font><font color="#DD0000">'String'</font><font color="#007700">, array(</font><font color="#DD0000">'many'</font><font color="#007700">=></font><font color="#0000BB">true</font><font color="#007700">));<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.sdo-das-changesummary-islogging.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.sdo-das-datafactory-addtype.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >SDO_DAS_ChangeSummary::isLogging</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.sdo.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >SDO_DAS_DataFactory::addType</TD ></TR ></TABLE ></DIV ></BODY ></HTML >