Habari\Post::get_revision_data PHP Method

get_revision_data() public method

Get the fields of the post that differ from what is stored by date
public get_revision_data ( DateTime | string | integer $date ) : array
$date DateTime | string | integer The date to fetch the revision of
return array An array of field data for the post with the values of those fields at the specified date
    public function get_revision_data($date)
    {
        $sql = <<<GET_REVISION_DATA
SELECT
id, post_id, change_field, old_value, user_id, min(change_date) as change_date
FROM {revisions}
WHERE
post_id = :post_id
AND change_date > :rev_date
GROUP BY change_field
ORDER BY change_date;
GET_REVISION_DATA;
        return DB::get_results($sql, array('post_id' => $this->id, 'rev_date' => DateTime::create($date)->sql));
    }