Пример #1
0
 /**
  * Add a domain object to the extension. Creates the reverse link as well.
  * @param \EBT\ExtensionBuilder\Domain\Model\DomainObject $domainObject
  */
 public function addDomainObject(\EBT\ExtensionBuilder\Domain\Model\DomainObject $domainObject)
 {
     $domainObject->setExtension($this);
     foreach (array_keys($this->domainObjects) as $existingDomainObjectName) {
         if (strtolower($domainObject->getName()) == strtolower($existingDomainObjectName)) {
             throw new \EBT\ExtensionBuilder\Domain\Exception\ExtensionException('Duplicate domain object name "' . $domainObject->getName() . '".', \EBT\ExtensionBuilder\Domain\Validator\ExtensionValidator::ERROR_DOMAINOBJECT_DUPLICATE);
         }
     }
     if ($domainObject->getNeedsUploadFolder()) {
         $this->needsUploadFolder = TRUE;
     }
     $this->domainObjects[$domainObject->getName()] = $domainObject;
 }