phpbb\notification\type\post::pre_create_insert_array PHP Метод

pre_create_insert_array() публичный Метод

Pre create insert array function This allows you to perform certain actions, like run a query and load data, before create_insert_array() is run. The data returned from this function will be sent to create_insert_array().
public pre_create_insert_array ( array $post, array $notify_users ) : array
$post array Post data from submit_post
$notify_users array Notify users list Formated from find_users_for_notification()
Результат array Whatever you want to send to create_insert_array().
    public function pre_create_insert_array($post, $notify_users)
    {
        if (!sizeof($notify_users) || !$this->inherit_read_status) {
            return array();
        }
        $tracking_data = array();
        $sql = 'SELECT user_id, mark_time FROM ' . TOPICS_TRACK_TABLE . '
			WHERE topic_id = ' . (int) $post['topic_id'] . '
				AND ' . $this->db->sql_in_set('user_id', array_keys($notify_users));
        $result = $this->db->sql_query($sql);
        while ($row = $this->db->sql_fetchrow($result)) {
            $tracking_data[$row['user_id']] = $row['mark_time'];
        }
        $this->db->sql_freeresult($result);
        return $tracking_data;
    }