122 $this->db =
$DIC->database();
135 $res = $this->db->queryF(
136 'SELECT * FROM frm_drafts_history WHERE history_id = %s',
141 while (
$row = $this->db->fetchAssoc(
$res)) {
156 'SELECT * FROM frm_drafts_history WHERE draft_id = %s ORDER BY draft_date DESC',
160 $instances = array();
165 $instances[] = $tmp_obj;
184 return $history_draft;
187 public function delete()
189 $this->db->manipulatef(
190 'DELETE FROM frm_drafts_history WHERE history_id = %s',
201 $res = $this->db->queryF(
202 'SELECT * FROM frm_drafts_history WHERE draft_id = %s
203 ORDER BY history_id ASC',
208 if (
$row = $this->db->fetchAssoc(
$res)) {
220 $res = $this->db->queryF(
221 'SELECT * FROM frm_drafts_history WHERE draft_id = %s
222 ORDER BY history_id DESC',
227 while (
$row = $this->db->fetchAssoc(
$res)) {
237 $next_id = $this->db->nextId(
'frm_drafts_history');
239 'frm_drafts_history',
240 array(
'history_id' => array(
'integer', $next_id),
241 'draft_id' => array(
'integer', $this->
getDraftId()),
244 'draft_date' => array(
'timestamp',
date(
"Y-m-d H:i:s"))
253 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
257 foreach ($mediaObjects as $mob) {
258 foreach ($myMediaObjects as $myMob) {
259 if ($mob == $myMob) {
271 require_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
274 foreach ($oldMediaObjects as $oldMob) {
291 self::MEDIAOBJECT_TYPE,
297 $draft->updateDraft();
308 $draft_ids = array();
309 if (count($post_ids) > 0) {
310 $res = $this->db->query(
'
311 SELECT frm_drafts_history.history_id, frm_drafts_history.draft_id
312 FROM frm_posts_drafts
313 INNER JOIN frm_drafts_history ON frm_posts_drafts.draft_id
314 WHERE ' . $this->db->in(
'post_id', $post_ids,
false,
'integer'));
316 while (
$row = $this->db->fetchAssoc(
$res)) {
317 $draft_ids[] =
$row[
'draft_id'];
327 if (count($draft_ids) > 0) {
328 $res = $this->db->query(
'SELECT history_id FROM frm_drafts_history
329 WHERE ' . $this->db->in(
'draft_id', $draft_ids,
false,
'integer'));
331 while (
$row = $this->db->fetchAssoc(
$res)) {
336 $this->db->manipulate(
'DELETE FROM frm_drafts_history WHERE '
337 . $this->db->in(
'draft_id', $draft_ids,
false,
'integer'));
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
Class ilForumDraftHistory.
readByHistoryId($history_id)
setHistoryId($history_id)
deleteHistoryByDraftIds($draft_ids=array())
setDraftDate($draft_date)
getLastAutosaveByDraftId($draft_id)
static populateWithDatabaseRecord(ilForumDraftsHistory $history_draft, array $row)
addMobsToDraftsHistory($message)
deleteHistoryByPostIds($post_ids=array())
__construct($history_id=0)
ilForumDraftsHistory constructor.
setPostSubject($post_subject)
static getInstancesByDraftId($draft_id)
setPostMessage($post_message)
getFirstAutosaveByDraftId($draft_id)
static newInstanceByDraftId($draft_id)
static moveMediaObjects($post_message, $source_type, $source_id, $target_type, $target_id, $direction=0)
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
catch(Exception $e) $message
foreach($_POST as $key=> $value) $res