/** * Cria os métodos para manipulação dos atributos do nó. * @param \PhpClass $class * @param \DOMElement $node */ public function createAttributeMethods(\PhpClass &$class, \DOMElement $node) { $methodName = $node->getAttribute('name'); $returnType = in_array($node->getAttribute('type'), array('string')) ? null : $class->getFullName(); $class->addMethod($this->createAttributeGetMethod($methodName)); $class->addMethod($this->createAttributeSetMethod($methodName, $returnType)); if ($node->hasAttribute('use') and $node->getAttribute('use') == 'optional') { $class->addMethod($this->createAttributeIsSetMethod($methodName)); $class->addMethod($this->createAttributeUnsetMethod($methodName)); } }