AttributeOption::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : Attribute
return Attribute the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

示例#1
0
 public function beforeValidate()
 {
     if ($this->attribute_option_id) {
         $option = AttributeOption::model()->findByPk($this->attribute_option_id);
         $this->attribute_value = $option ? $option->value : null;
     }
     if (!$this->attribute_value) {
         $this->addErrors(['attribute_value' => Yii::t('StoreModule.store', 'You must specify the attribute value')]);
     }
     return parent::beforeValidate();
 }
All Usage Examples Of AttributeOption::model