<?php

class DiagnosticPresenter extends SimpleDelegator
{

  static function getProperty($diagnstic, $propertyName)
  {
    if(is_null($diagnstic))
      return null;

    $presenter = new DiagnosticPresenter($diagnstic);

    return call_user_func(array($presenter, $propertyName));
  }
  public function getLevelIcon()
  {
    switch ($this->type)
    {
      case 'alarm':
        $icon = CHtml::tag('span', array('class' => 'icon-exclamation alarm-icon'));
        break;
      case 'warning':
        $icon = CHtml::tag('span', array('class' => 'icon-warning-sign warning-icon'));
        break;
      default:
        $icon = CHtml::tag('span', array('class' => 'icon-info-sign info-icon'));
        break;
    }
    return $icon;
  }

}
