Optimizer_Unit_Page.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Optimizer unit page file.
  4. *
  5. * Provides a class with all the properties and methods to display the page.
  6. *
  7. * @author Iñigo Valentin <i@inigovalentin.com>
  8. * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3
  9. * @package SWDB
  10. */
  11. require_once(PATH::PAGE . "Page.php");
  12. require_once(PATH::ENTITY . "Unit.php");
  13. /**
  14. * Optimizer team list page model.
  15. *
  16. * @category Page
  17. */
  18. class Optimizer_Unit_Page extends Page{
  19. /**
  20. * @var Unit The unit to optimize.
  21. */
  22. private $unit;
  23. /**
  24. * Constructor.
  25. *
  26. * Retrieves the data and initializes the variables.
  27. *
  28. * @param string $id Selected unit id.
  29. */
  30. public function __construct($id){
  31. $this->view = PATH::VIEW . "optimizer_unit.php";
  32. $this->unit = new Unit($id);
  33. $this->title = "Optimize " . $this->unit->get_title() . " - SWDB";
  34. $this->description = "Optimize " . $this->unit->get_title();
  35. $this->canonical = URL::BASE . "optimizer/$id";
  36. }
  37. /**
  38. * Retrieves the unit to optimize.
  39. *
  40. * @return Unit Unit to optimize.
  41. */
  42. public function get_unit(){
  43. return $this->unit;
  44. }
  45. }
  46. ?>