AttributeValue::model PHP Method

model() public static method

Please note that you should have this exact method in all your CActiveRecord descendants!
public static model ( string $className = __CLASS__ ) : AttributeValue
$className string active record class name.
return AttributeValue the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

Esempio n. 1
0
 public static function getTeacherAttributeValue($teacher, $attribute){
     $result = '';
     switch($attribute){
         case '1': //capacity
             $result = AttributeValue::model()->findByAttributes(array('teacher'=>$teacher, 'attribute'=>$attribute))->value;
             break;
         case '2': //trainer's students
             $result = TeacherHelper::getTrainerStudents($teacher);
             break;
         case '3': //consultant_modules
             $result = TeacherHelper::getConsultantModules($teacher);
             break;
         case '4':// leader's projects
             $result = TeacherHelper::getLeaderProjects($teacher);
             break;
         case '6'://leader's modules
             $result = TeacherHelper::getLeaderModules($teacher);
             break;
         case '7'://author's modules
             $result = TeacherHelper::getLeaderModules($teacher);
             break;
         case '8'://leader's capacity
             $result = AttributeValue::model()->findByAttributes(array('teacher'=>$teacher, 'attribute'=>$attribute))->value;
             break;
         default:
             $result = AttributeValue::model()->findByAttributes(array('teacher'=>$teacher, 'attribute'=>$attribute))->value;
     }
     return $result;
 }
All Usage Examples Of AttributeValue::model