/** * Function for preparing the data for insertion in an SQL query * (The service handles insertion) * * @param array $post Data from submit_post * @param array $pre_create_data Data from pre_create_insert_array() * * @return array Array of data ready to be inserted into the database */ public function create_insert_array($post, $pre_create_data = array()) { $this->set_data('poster_id', $post['poster_id']); $this->set_data('topic_title', $post['topic_title']); $this->set_data('post_subject', $post['post_subject']); $this->set_data('post_username', $post['poster_id'] == ANONYMOUS ? $post['post_username'] : ''); $this->set_data('forum_id', $post['forum_id']); $this->set_data('forum_name', $post['forum_name']); $this->notification_time = $post['post_time']; // Topics can be "read" before they are public (while awaiting approval). // Make sure that if the user has read the topic, it's marked as read in the notification if ($this->inherit_read_status && isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time) { $this->notification_read = true; } return parent::create_insert_array($post, $pre_create_data); }
/** * Function for preparing the data for insertion in an SQL query * (The service handles insertion) * * @param array $pm Data from submit_post * @param array $pre_create_data Data from pre_create_insert_array() * * @return array Array of data ready to be inserted into the database */ public function create_insert_array($pm, $pre_create_data = array()) { $this->set_data('from_user_id', $pm['from_user_id']); $this->set_data('message_subject', $pm['message_subject']); return parent::create_insert_array($pm, $pre_create_data); }
/** * {@inheritdoc} */ public function create_insert_array($group, $pre_create_data = array()) { $this->set_data('group_name', $group['group_name']); return parent::create_insert_array($group, $pre_create_data); }
/** * {@inheritdoc} */ public function create_insert_array($user, $pre_create_data) { $this->set_data('user_actkey', $user['user_actkey']); $this->notification_time = $user['user_regdate']; return parent::create_insert_array($user, $pre_create_data); }