コード例 #1
0
 public static function ajaxDeleteTemplate($data, $func)
 {
     if (!current_user_can('wpProQuiz_edit_quiz')) {
         return json_encode(array());
     }
     $templateMapper = new WpProQuiz_Model_TemplateMapper();
     $template = new WpProQuiz_Model_Template($data);
     $templateMapper->delete($template->getTemplateId());
     return json_encode(array());
 }
コード例 #2
0
 /**
  * @param WpProQuiz_Model_Template $template
  * @return WpProQuiz_Model_Template
  */
 public function save($template)
 {
     $this->_wpdb->replace($this->_tableTemplate, array('template_id' => $template->getTemplateId(), 'name' => $template->getName(), 'type' => $template->getType(), 'data' => @serialize($template->getData())), array('%d', '%s', '%d', '%s'));
     $template->setTemplateId($this->getInsertId());
     return $template;
 }