Item::rules PHP Method

rules() public method

public rules ( ) : array
return array validation rules for model attributes.
    public function rules()
    {
        // NOTE: you should only define rules for those attributes that
        // will receive user inputs.
        return array(array('title, min_number, desc, language, category_id', 'required'), array('type_id, stock, is_show, is_promote, is_new, is_hot, is_best, is_discount, sort_order', 'numerical', 'integerOnly' => true), array('category_id, market_price, shop_price, post_fee, express_fee, ems_fee', 'length', 'max' => 10), array('title, pic_url', 'length', 'max' => 255), array('sn', 'length', 'max' => 60), array('unit, currency', 'length', 'max' => 20), array('min_number', 'length', 'max' => 100), array('location, language', 'length', 'max' => 45), array('click_count, create_time, update_time', 'length', 'max' => 11), array('skus, props, props_name, item_imgs, prop_imgs, desc', 'safe'), array('item_id, category_id, title, sn, unit, stock, min_number, market_price, shop_price, currency, skus, props, props_name, item_imgs, prop_imgs, pic_url, desc, location, post_fee, express_fee, ems_fee, is_show, is_promote, is_new, is_hot, is_best, is_discount, click_count, sort_order, create_time, update_time, language', 'safe', 'on' => 'search'));
    }