Esempio n. 1
0
 /**
  *
  * create a new class object based on the template and the related domain object
  *
  * @param \EBT\ExtensionBuilder\Domain\Model\DomainObject $domainObject
  *
  * @return void
  */
 protected function createNewModelClassObject($domainObject)
 {
     $this->classFileObject = clone $this->templateFileObject;
     $this->classObject = clone $this->templateFileObject->getFirstClass();
     $this->classObject->resetAll();
     // start with plain class
     $this->classObject->setName($domainObject->getName());
     if ($domainObject->isEntity()) {
         $parentClass = $domainObject->getParentClass();
         if (empty($parentClass)) {
             $parentClass = $this->configurationManager->getParentClassForEntityObject($this->extension->getExtensionKey());
         }
     } else {
         $parentClass = $this->configurationManager->getParentClassForValueObject($this->extension->getExtensionKey());
     }
     $this->classObject->setParentClassName($parentClass);
     $this->classObject->setDescription($domainObject->getDescription());
 }