/**
  * This method generates the repository class object, which is passed to the template
  * it keeps all methods and properties including user modified method bodies and comments
  * needed to create a repository class file
  *
  * @param Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject
  * @param boolean $mergeWithExistingClass
  *
  * @return Tx_ExtensionBuilder_Domain_Model_Class_Class
  */
 public function generateRepositoryClassObject($domainObject, $mergeWithExistingClass)
 {
     t3lib_div::devlog('------------------------------------- generateRepositoryClassObject(' . $domainObject->getName() . ') ---------------------------------', 'extension_builder', 1);
     $this->classObject = NULL;
     $className = $domainObject->getDomainRepositoryClassName();
     if ($mergeWithExistingClass) {
         try {
             $this->classObject = $this->roundTripService->getRepositoryClass($domainObject);
         } catch (Exception $e) {
             t3lib_div::devLog('Class ' . $className . ' could not be imported: ' . $e->getMessage(), 'extension_builder');
         }
     }
     if ($this->classObject == NULL) {
         $this->classObject = new Tx_ExtensionBuilder_Domain_Model_Class_Class($className);
         if (isset($this->settings['Repository']['parentClass'])) {
             $parentClass = $this->settings['Repository']['parentClass'];
         } else {
             $parentClass = 'Tx_Extbase_Persistence_Repository';
         }
         $this->classObject->setParentClass($parentClass);
     }
     return $this->classObject;
 }