<?php

class EpisodeComment
{
	private $ID;
	private $Author;
	private $Content;
	private $PostDate;
	private $ShowID;

	public function __construct($id)
	{
		$this->ID = $id;

		$result = Database::select('episodecomments', '*', 'WHERE id = :id', data: [':id' => $id]);

		$data = $result->fetch();

		$this->Author   = $data['commentAuthor'];
		$this->Content  = $data['commentContent'];
		$this->PostDate = betterDate($data['commentDate']);
		$this->ShowID   = $data['showID'];
	}

	public function __get($what)
	{
		return property_exists($this, $what) ? $this->{$what} : null;
	}
}
