本文整理汇总了PHP中Attribute::setStereoType方法的典型用法代码示例。如果您正苦于以下问题:PHP Attribute::setStereoType方法的具体用法?PHP Attribute::setStereoType怎么用?PHP Attribute::setStereoType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attribute
的用法示例。
在下文中一共展示了Attribute::setStereoType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createExternalDataTypes
function createExternalDataTypes($dbSchema)
{
$this->logger->log('<b>Create external data types:</b>');
#*******************************
# SC_CRS
#*******************************
$dataType = new DataType('SC_CRS', 'DataType', $this->logger);
$this->logger->log('<br><b>' . $dataType->name . '</b>');
$dataType->setSchemas($this, $dbSchema);
$dataType->setId(0);
# create Attributes
$dataTypeAttribute = new Attribute('scope', 'CharacterString', $dataType->name);
$dataTypeAttribute->setStereoType('CharacterString');
$dataTypeAttribute->attribute_type = 'ISO 19136 GML Type';
$dataTypeAttribute->setMultiplicity('1', '-1');
$this->logger->log('<br>attribute: <b>' . $dataTypeAttribute->name . '</b>
datatype: <b>' . $dataTypeAttribute->datatype . '</b>
stereotype: <b>' . $dataTypeAttribute->stereotype . '</b>');
$dataType->addAttribute($dataTypeAttribute);
# Create Comments
$comment = $dataTypeAttribute->attribute_type . ': ' . $dataTypeAttribute->name;
$comment .= ' ' . $dataTypeAttribute->multiplicity;
$dataType->addComment($comment);
# Erzeuge SQL und registriere DataType in Liste
$dataTypeSql = $dataType->asSql();
$this->logger->log('<pre>' . $dataTypeSql . '</pre>');
$sql .= $dataTypeSql;
$this->dataTypes[$dataType->name] = $dataType;
#*******************************
# Query
#*******************************
$dataType = new DataType('Query', 'DataType', $this->logger);
$this->logger->log('<br><b>' . $dataType->name . '</b>');
$dataType->setSchemas($this, $dbSchema);
$dataType->setId(0);
# create Attributes
$dataTypeAttribute = new Attribute('url', 'CharacterString', $dataType->name);
$dataTypeAttribute->setStereoType('CharacterString');
$dataTypeAttribute->attribute_type = 'wfs:Query nach Web Feature Service Specifikation, Version 1.0.0';
$dataTypeAttribute->setMultiplicity('0', '1');
$this->logger->log('<br>attribute: <b>' . $dataTypeAttribute->name . '</b>
datatype: <b>' . $dataTypeAttribute->datatype . '</b>
stereotype: <b>' . $dataTypeAttribute->stereotype . '</b>');
$dataType->addAttribute($dataTypeAttribute);
# Create Comments
$comment = $dataTypeAttribute->attribute_type . ': ' . $dataTypeAttribute->name;
$comment .= ' ' . $dataTypeAttribute->multiplicity;
$dataType->addComment($comment);
# Erzeuge SQL und registriere DataType in Liste
$dataTypeSql = $dataType->asSql();
$this->logger->log('<pre>' . $dataTypeSql . '</pre>');
$sql .= $dataTypeSql;
$this->dataTypes[$dataType->name] = $dataType;
#*******************************
# Transaction
#*******************************
$dataType = new DataType('Transaction', 'DataType', $this->logger);
$this->logger->log('<br><b>' . $dataType->name . '</b>');
$dataType->setSchemas($this, $dbSchema);
$dataType->setId(0);
# create Attributes
$dataTypeAttribute = new Attribute('content', 'Text', $dataType->name);
$dataTypeAttribute->setStereoType('CharacterString');
$dataTypeAttribute->attribute_type = 'wfs:Transaction nach Web Feature Service Specifikation, Version 1.0.0';
$dataTypeAttribute->setMultiplicity('0', '1');
$this->logger->log('<br>attribute: <b>' . $dataTypeAttribute->name . '</b>
datatype: <b>' . $dataTypeAttribute->datatype . '</b>
stereotype: <b>' . $dataTypeAttribute->stereotype . '</b>');
$dataType->addAttribute($dataTypeAttribute);
# Create Comments
$comment = $dataTypeAttribute->attribute_type . ': ' . $dataTypeAttribute->name;
$comment .= ' ' . $dataTypeAttribute->multiplicity;
$dataType->addComment($comment);
# Erzeuge SQL und registriere DataType in Liste
$dataTypeSql = $dataType->asSql();
$this->logger->log('<pre>' . $dataTypeSql . '</pre>');
$sql .= $dataTypeSql;
$this->dataTypes[$dataType->name] = $dataType;
#*******************************
# doubleList
#*******************************
$dataType = new DataType('doubleList', 'DataType', $this->logger);
$this->logger->log('<br><b>' . $dataType->name . '</b>');
$dataType->setSchemas($this, $dbSchema);
$dataType->setId(0);
# create Attributes
$dataTypeAttribute = new Attribute('list', 'Sequence', $dataType->name);
$dataTypeAttribute->setStereoType('Sequence');
$dataTypeAttribute->attribute_type = 'ISO 19136 GML Type';
$dataTypeAttribute->setMultiplicity('0', '1');
$this->logger->log('<br>attribute: <b>' . $dataTypeAttribute->name . '</b>
datatype: <b>' . $dataTypeAttribute->datatype . '</b>
stereotype: <b>' . $dataTypeAttribute->stereotype . '</b>');
$dataType->addAttribute($dataTypeAttribute);
# Create Comments
$comment = $dataTypeAttribute->attribute_type . ': ' . $dataTypeAttribute->name;
$dataType->addComment($comment);
# Erzeuge SQL und registriere DataType in Liste
$dataTypeSql = $dataType->asSql();
$this->logger->log('<pre>' . $dataTypeSql . '</pre>');
//.........这里部分代码省略.........
示例2: getAttributesUntilLeafs
function getAttributesUntilLeafs($type, $stereotype, $parts)
{
$return_attributes = array();
if (substr($type, 0, 3) == 'DQ_') {
/* Damit die DQ_ Elemente gefunden werden mussen Sie in classes existieren.
* Hier Beispiele zum anlegen der uml_classes
* INSERT INTO aaa_uml.uml_classes (xmi_id, name, stereotype_id)
* values ('eaxmiid51', 'DQ_AbsoluteExternalPositionalAccuracy', 'EAID_BED119C1_311A_4a74_996D_121184388A0F')
* INSERT INTO aaa_uml.uml_classes (xmi_id, name, stereotype_id)
* values ('eaxmiid47', 'DQ_RelativeInternalPositionalAccuracy', 'EAID_BED119C1_311A_4a74_996D_121184388A0F')
*/
$attributes = $this->umlSchema->getExternalClassAttributes($type);
} else {
$attributes = $this->umlSchema->getClassAttributes($type);
}
foreach ($attributes as $attribute) {
if (!$this->is_filtered('attribute', $type, $attribute['attribute_name'])) {
if (!empty($attribute['attribute_name'])) {
if (empty($parts)) {
$parent = $this;
} else {
#if ($attribute['class_name'] == 'AA_Modellart') echo '<br> class: ' . $attribute['class_name'] . ' class stereotype: ' . $stereotype . ' attribute name: ' . $attribute['attribute_name'] . ' datatype: ' . $attribute['attribute_datatype'] . ' stereotyp: ' . $attribute['attribute_stereotype'];
$parent = new Datatype($attribute['class_name'], $stereotype, $this->logger, $this->enumerations);
$parent->ogrSchema = $this->ogrSchema;
}
$attributeObj = new Attribute(($attribute['attribute_name'] == 'position' and GEOMETRY_COLUMN_NAME != '') ? GEOMETRY_COLUMN_NAME : $attribute['attribute_name'], $attribute['attribute_datatype'], $parent, $parts);
$attributeObj->setStereoType($attribute['attribute_stereotype']);
# Union Typen können nicht not null sein, weil immer eines der Attribute
# des Union Types verwendet wird. Also andere weggelassen werden.
# Sonderfall, wenn ein Union Typ nur ein Attribut hätte, aber das wäre
# für einen Union Typ sinnlos, weil er ja dafür da ist, dass man ein
# Attribut aus verschiedenen auswählt.
#if ($type == 'AX_Lagebezeichnung') echo '<br>typ: ' . $type . ' attribute: ' . $attributeObj->name . ' stereotype: ' . $stereotype;
$attributeObj->setMultiplicity(($attribute['attribute_name'] == 'position' or $stereotype == 'union') ? 0 : $attribute['multiplicity_range_lower'], $attribute['multiplicity_range_upper']);
$new_path = $parts;
array_push($new_path, $attributeObj);
if (in_array(strtolower($attribute['attribute_stereotype']), array('datatype', 'union'))) {
foreach ($this->getAttributesUntilLeafs($attribute['attribute_datatype'], $attribute['attribute_stereotype'], $new_path) as $child_attribute) {
$return_attributes[] = $child_attribute;
}
} else {
$return_attributes[] = $new_path;
}
}
}
}
$this->attributes_until_leafs = $return_attributes;
return $return_attributes;
}