Ejemplo n.º 1
0
 /**
  * Generates the code for the controller class
  * Either from ectionController template or from class partial
  *
  * @param Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject
  * @param boolean $mergeWithExistingClass
  */
 public function generateActionControllerCode(Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject, $mergeWithExistingClass)
 {
     $controllerClassObject = $this->classBuilder->generateControllerClassObject($domainObject, $mergeWithExistingClass);
     // returns a class object if an existing class was found
     if ($controllerClassObject) {
         $classDocComment = $this->renderDocComment($controllerClassObject, $domainObject);
         $controllerClassObject->setDocComment($classDocComment);
         return $this->renderTemplate('Classes/class.phpt', array('domainObject' => $domainObject, 'extension' => $this->extension, 'classObject' => $controllerClassObject));
     } else {
         throw new Exception('Class file for controller could not be generated');
     }
 }