Check Rule is enabled or not

Check if a rule is enabled.

if ( class_exists('\Wdr\App\Controllers\ManageDiscount')) {
	
	$manage_discount = new \Wdr\App\Controllers\ManageDiscount();
	$rules = $manage_discount->getDiscountRules();
	
	foreach ($rules as $rule){
            //loop
            
	    //$rule->getRuleDiscountType() ->it will return discount type
	    //array(1,2) -> change your rule id instead of 1,2
	    //$timestamp -> boolean (true or false)
	    //$rule->getStartDate($timestamp = false, $format = "Y-m-d H:i:s") -> You can get start date in timestamp or dateformat
	    //$rule->getEndDate($timestamp = false, $format = "Y-m-d H:i:s") -> You can get end date in timestamp or dateformat
	    if($rule->getRuleDiscountType() == 'wdr_free_shipping' && in_array($rule->getId(),array(1,2)) && $rule->isEnabled()){
		//action required if condition passed
	    }
                
         }
		 
  }