keys() public static method

Return statuses keys
public static keys ( ) : array
return array
Exemplo n.º 1
0
Arquivo: Coupon.php Projeto: yupe/yupe
 /**
  * @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 [['name, code, status, type', 'required'], ['name, code', 'filter', 'filter' => 'trim'], ['name, code', 'length', 'max' => 255], ['status', 'in', 'range' => CouponStatus::keys()], ['type', 'in', 'range' => CouponType::keys()], ['value, min_order_price', 'numerical'], ['quantity, quantity_per_user', 'numerical', 'integerOnly' => true], ['registered_user, free_shipping', 'in', 'range' => [0, 1]], ['start_time, end_time', 'date', 'format' => 'yyyy-MM-dd'], ['code', 'unique'], ['id, name, code, type, value, min_order_price, registered_user, free_shipping, start_time, end_time, quantity, quantity_per_user, status', 'safe', 'on' => 'search']];
 }