* @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3 * @package SWDB */ require_once(PATH::PAGE . "Page.php"); require_once(PATH::ENTITY . "Unit.php"); /** * Unit view page model. * * @category Page */ class Unit_Page extends Page{ /** * @var Unit Selected Unit. */ private $unit; /** * Constructor. * * Retrieves the data and initializes the variables. * * @param string $id Selected unit id */ public function __construct($id){ $this->view = PATH::VIEW . "unit.php"; $this->unit = new Unit($id, true); $this->title = $this->unit->get_title() ." - SWDB"; $this->description = "Owned " . $this->unit->get_title(); $this->canonical = URL::BASE . "monster/" . $id; } /** * Retrieves the selected unit. * * @return Unit Selected unit. */ public function get_unit(){ return $this->unit; } }