Example #1
0
 /**
  * Return a form object based on the Variables in the current object.
  * @return \Form
  */
 public function pullForm()
 {
     $vars = $this->getVars();
     $form = new \Form();
     foreach ($vars as $parameter) {
         if ($parameter instanceof \Variable) {
             if ($parameter->getVarname() == 'id') {
                 $input = $parameter->getInput();
                 $input->setId('resource-id');
                 $form->plugInput($input);
             } else {
                 $form->addVariable($parameter);
             }
         }
     }
     return $form;
 }
Example #2
0
 /**
  * Receives a form object and implants the current variable as an input
  * @param Form $form
  */
 public function loadInput(Form $form)
 {
     $input = $this->getInput();
     $form->plugInput($input);
 }