Exemplo n.º 1
0
 /**
  *
  * @param array $params require:
  * 'prizedTime' => (datetime) date time when user were awarded with this medal
  * 'type' => medal type
  */
 public function __construct($params)
 {
     $this->medalId = $params['medalId'];
     $details = \lib\Controllers\MedalsController::getMedalConfigByMedalId($this->medalId);
     $this->conditions = $details['conditions'];
     $this->name = $details['name'];
     $this->description = $details['description'];
     $this->dateIntroduced = $details['dateIntroduced'];
     if (isset($params['prizedTime'])) {
         $this->prizedTime = $params['prizedTime'];
         $this->level = (int) $params['level'];
         $this->setImage();
     }
     $this->config = \lib\Objects\OcConfig\OcConfig::instance();
 }