/**
  * Add a domain object to the extension. Creates the reverse link as well.
  * @param Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject
  */
 public function addDomainObject(Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject)
 {
     $domainObject->setExtension($this);
     if (in_array($domainObject->getName(), array_keys($this->domainObjects))) {
         throw new Tx_ExtensionBuilder_Domain_Exception_ExtensionException('Duplicate domain object name "' . $domainObject->getName() . '".', Tx_ExtensionBuilder_Domain_Validator_ExtensionValidator::ERROR_DOMAINOBJECT_DUPLICATE);
     }
     if ($domainObject->getNeedsUploadFolder()) {
         $this->needsUploadFolder = TRUE;
     }
     $this->domainObjects[$domainObject->getName()] = $domainObject;
 }