public function generate(Generator\ClassGenerator $class, PHPClass $type)
{
$docblock = new DocBlockGenerator("Class representing " . $type->getName());
if ($type->getDoc()) {
$docblock->setLongDescription($type->getDoc());
}
$class->setNamespaceName($type->getNamespace() ?: NULL);
$class->setName($type->getName());
$class->setDocblock($docblock);
if ($extends = $type->getExtends()) {
if ($p = $this->isOneType($extends)) {
$this->handleProperty($class, $p);
$this->handleValueMethod($class, $p, $extends);
} else {
$class->setExtendedClass($extends->getName());
if ($extends->getNamespace() != $type->getNamespace()) {
if ($extends->getName() == $type->getName()) {
$class->addUse($type->getExtends()->getFullName(), $extends->getName() . "Base");
$class->setExtendedClass($extends->getName() . "Base");
} else {
$class->addUse($extends->getFullName());
}
}
}
}
if ($this->handleBody($class, $type)) {
return true;
}
}