OptionValue::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( string $className = __CLASS__ ) : OptionValue
$className string active record class name.
return OptionValue the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

 public function optionDataColumn($data, $row)
 {
     $op = "";
     if (!empty($data->order_options)) {
         foreach ($data->order_options as $i => $option) {
             //$op += "<span class=\'option\'><span class=\'label\'>{$option->name}</span><span class=\'text\'>";
             $op += $option->name . ': ';
             if ($option->type == "select" || $option->type == "radio" || $option->type == "checkbox") {
                 $optval = OptionValue::model()->findByPk($option->product_option_value_id);
                 if (!empty($optval)) {
                     $op += $optval->getName();
                     if (isset($option[$i + 1]) && $option[$i + 1]->product_option_id == $option[$i]->product_option_id) {
                         $op += ", ";
                     }
                 }
             } else {
                 $op += $option->value;
             }
             $op += "\n";
         }
     }
     return $op;
 }
All Usage Examples Of OptionValue::model