/** * Returns the user form record * This method could accept a template object * or simply a user form ID. Both of this is * passed through the variable $template. * * The flag $templateIsId decides what is passed */ public static function GetFormFromTaskTemplateFrom($caller, $template, $templateIsId = false) { $userformDAO = new \Applications\PMTool\Models\Dao\User_form(); if ($templateIsId) { $userformDAO->setForm_id($template); } else { $userformDAO->setForm_id($template->user_form_id()); } $dal = $caller->managers()->getManagerOf("Task"); return $dal->selectMany($userformDAO, "form_id"); }
public static function PrepareUserFormObject($dataPost) { $form = new \Applications\PMTool\Models\Dao\User_form(); $form->setPm_id($dataPost['pm_id']); $form->setTitle($dataPost['title']); $form->setCategory(null); return $form; }