function set_class_col($col, $val = '') { if (!isset($col) || empty($col)) { return false; } $validator = new validator(); $isValid = $validator->check_value($col, $val, $col, "string", 0, 255); if ($isValid) { $this->{$col} = $val; } else { foreach ($validator->error_list as $key => $data) { $this->set_message($validator->error_list[$key]["msg"]); } } return $isValid; }