예제 #1
0
파일: Education.php 프로젝트: Jazzee/Jazzee
 /**
  * Check variables before they are set
  * @param string $name
  * @param string $value
  * @throws \Jazzee\Exception
  */
 public function setVar($name, $value)
 {
     switch ($name) {
         case 'schoolListType':
             if (!in_array($value, array('full', 'partial'))) {
                 throw new \Jazzee\Exception("{$value} is not a valid option for schoolListType");
             }
             break;
         case 'partialSchoolList':
             $value = preg_replace("/[^0-9,]+/", "", $value);
             break;
     }
     parent::setVar($name, $value);
 }