/**
  * Generates the code for the domain model class
  * Either from domainObject template or from class partial
  *
  * @param Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject
  * @param boolean $mergeWithExistingClass
  */
 public function generateDomainObjectCode(Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject, $mergeWithExistingClass)
 {
     $modelClassObject = $this->classBuilder->generateModelClassObject($domainObject, $mergeWithExistingClass);
     if ($modelClassObject) {
         $classDocComment = $this->renderDocComment($modelClassObject, $domainObject);
         $modelClassObject->setDocComment($classDocComment);
         return $this->renderTemplate('Classes/class.phpt', array('domainObject' => $domainObject, 'extension' => $this->extension, 'classObject' => $modelClassObject));
     } else {
         throw new Exception('Class file for domain object could not be generated');
     }
 }