Esempio n. 1
0
 protected function buildActionMethod($methodName, dmModuleComponent $component)
 {
     switch ($component->getType()) {
         case 'list':
             $body = "\$query = \$this->getListQuery();\n\n\$this->{$this->module->getKey()}Pager = \$this->getPager(\$query);";
             break;
         case 'show':
             $body = "\$query = \$this->getShowQuery();\n\n\$this->{$this->module->getKey()} = \$this->getRecord(\$query);";
             break;
         case 'form':
             $body = "\$this->form = \$this->forms['{$this->module->getModel()}'];";
             break;
         default:
             $body = "// Your code here";
     }
     return new dmZendCodeGeneratorPhpMethod(array('indentation' => $this->indentation, 'name' => $methodName, 'visibility' => 'public', 'body' => $body));
 }
 protected function getActionTemplate(dmModuleComponent $component)
 {
     switch ($component->getType()) {
         case 'list':
             return $this->getListActionTemplate($component);
             break;
         case 'show':
             return $this->getShowActionTemplate($component);
             break;
         case 'form':
             return $this->getFormActionTemplate($component);
             break;
         default:
             return $this->getUserActionTemplate($component);
             break;
     }
 }