<?php
include_once('BDD.class.php');
include_once('Instance.class.php');
include_once('Candidate.class.php');

class Challenge2005
{
  private $instances;
 
  public function __construct()
  {
    $bdd = BDD::getBDD();
    $req = $bdd->query('SELECT * FROM InstancesX');
    $this->instances = array();
    while($result = $req->fetch())
      {
	$id =  $result['id_instance'];
	$temp_instance = new Instance($id);
	array_push($this->instances, $temp_instance);
      }
  }
  public function getInstances()
  {
    return $this->instances;
  }
}

?>