Order::rules PHP Method

rules() public method

public rules ( ) : array
return array validation rules for model attributes.
    public function rules()
    {
        return [['status_id, delivery_id', 'required'], ['name, email', 'required', 'on' => self::SCENARIO_USER], ['name, email, phone, zipcode, country, city, street, house, apartment', 'filter', 'filter' => 'trim'], ['email', 'email'], ['delivery_id, separate_delivery, payment_method_id, paid, user_id, couponId, manager_id', 'numerical', 'integerOnly' => true], ['delivery_price, total_price, discount, coupon_discount', 'store\\components\\validators\\NumberValidator'], ['name, phone, email, city, street', 'length', 'max' => 255], ['comment, note', 'length', 'max' => 1024], ['zipcode', 'length', 'max' => 30], ['house', 'length', 'max' => 50], ['country', 'length', 'max' => 150], ['apartment', 'length', 'max' => 10], ['url', 'unique'], ['user_id, paid, payment_time, payment_details, total_price, discount, coupon_discount, separate_delivery, status_id, date, ip, url, modified', 'unsafe', 'on' => self::SCENARIO_USER], ['id, delivery_id, delivery_price, payment_method_id, paid, payment_time, payment_details, total_price, discount, coupon_discount, separate_delivery, status_id, date, user_id, name, phone, email, comment, ip, url, note, modified, manager_id', 'safe', 'on' => 'search']];
    }