SDO _DAS _DataFactory: : addPropertyToType
(^)
SDO_DAS_DataFactory::addPropertyToType — Adds a property to a type
Description
$parent_type_namespace_uri
, string $parent_type_name
, string $property_name
, string $type_namespace_uri
, string $type_name
[, array $options
] ) : voidThis 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.
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.
Parameters
-
parent_type_namespace_uri
-
The namespace URI for the parent type.
-
parent_type_name
-
The type name for the parent type.
-
property_name
-
The name by which the property will be known in the parent type.
-
type_namespace_uri
-
The namespace URI for the type of the property.
-
type_name
-
The type name for the type of the property
-
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).
-
Changelog
Version | Description |
---|---|
0.5.2 | Optional parameters many, readOnly, and containment deprecated in favour of the options array. |
Examples
Example #1 A SDO_DAS_DataFactory::addPropertyToType() example
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'.
<?php
$df->addPropertyToType('PersonNS', 'PersonType',
'addressline', 'commonj.sdo', 'String', array('many'=>true));
?>
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-sdo-das-datafactory.addpropertytotype.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.