Пример #1
0
 public function __construct(PHP_UML_Metamodel_Superstructure $model = null)
 {
     if (!isset($model)) {
         $this->model = new PHP_UML_Metamodel_Superstructure();
         $this->model->initModel();
     } else {
         $this->model = $model;
     }
 }
Пример #2
0
 protected function addComment(DOMElement $element, PHP_UML_Metamodel_NamedElement $c)
 {
     $description = '';
     $parameters = $this->xpath->query('ownedComment', $element);
     foreach ($parameters as $item) {
         $description = trim($item->getAttribute('body') . $item->nodeValue);
     }
     if ($description == '') {
         $parameters = $this->xpath->query('//packagedComment[@annotatedElement="' . $c->id . '"]|//*[@xmi:type="uml:Comment" and @annotatedElement="' . $c->id . '"]');
         foreach ($parameters as $item) {
             $description = trim($item->getAttribute('body') . $item->nodeValue);
         }
     }
     $parameters = $this->xpath->query('//php:docblock[@base_Element="' . $c->id . '"]');
     $docblocks = array();
     foreach ($parameters as $item) {
         foreach ($item->childNodes as $item) {
             $docblock = array();
             $nodeName = $item->nodeName;
             $pos = strpos($nodeName, ':');
             $docblock[] = $pos === false ? $nodeName : substr($nodeName, $pos + 1);
             $docblock[] = $docblock[0];
             // see how tags were initially set in Parser
             $docblock[] = $item->nodeValue;
             $docblocks[] = $docblock;
         }
     }
     if (!empty($description) || count($docblocks) > 0) {
         $this->model->addDocTags($c, $description, $docblocks);
     }
 }