/** */ public function postAction() { // Filter data $data = $this->_helper->requestData(true); $data = $this->_helper->filter($data)->blacklist(array('id', 'organizationId')); $template = new TemplateModel($data); // Check if it's allowed $this->_helper->allowed('create', $template); $this->_templateSrv->create($template, \App::getOrgUserLogged()); // Response with the user id $this->view->data = $template->getId(); }
public function testCreateZonePlanTemplate() { $data = array('name' => "ZonePlanTest2", 'type' => "zonePlan", 'zoneGroups' => array(array('name' => "zoneGroup1", 'id' => 1, 'zones' => array("0")))); $this->_template = new TemplateModel($data); $this->_service->create($this->_template, \App::getOrgUserLogged()); }