SDO_DAS_DataFactory::addPropertyToType
(^)
SDO_DAS_DataFactory::addPropertyToType — اضافه کردن خاصیت به نوع
Description
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.
اضافه کردن خاصیت به یک نوع. نوع باید پیش از این برای SDO_DAS_DataFactory شناخته شده باشد (به عنوان مثال با استفاده از addType() اضافه شده باشد). خاصیت به خاصیت شی تبدیل میشود. مدل برای ساختار SDO_DataObject ساخته میشود.
Parameters
- parent_type_namespace_uri
-
فضای نام URI برای نوع والد.
- parent_type_name
-
نام نوع برای نوع والد.
- property_name
-
نام خاصیت برای نوع والد.
- type_namespace_uri
-
فضای نام URI برای نوع خاصیت.
- type_name
-
نام نوع برای نوع خاصیت
- options
-
This array holds one or more key=>value pairs to set attribute values for the property. The optional keywords are:
- many
-
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').
- readOnly
-
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').
- containment
-
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.
- default
-
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).
Return Values
None.
Changelog
| Version | Description |
|---|---|
| 0.5.2 | Optional parameters many, readOnly, and containment deprecated in favour of the options array. |
Examples
Example #1 مثال SDO_DAS_DataFactory::addPropertyToType()
مثال زیر خاصیت 'addressline' را به نوع Person اضافه میکند. نوع person توسط فضای نام، 'PersonNS'، و نام نوع، 'PersonType' شناخته میشود. نوع خاصیت 'addressline' نوع داده چندمقداره SDO (ابتدایی) با فضای نام 'commonj.sdo' و نام نوع 'String' است.
<?php
$df->addPropertyToType('PersonNS', 'PersonType',
'addressline', 'commonj.sdo', 'String', array('many'=>true));
?>
