/**
  * Checks whether the given class is supported for denormalization by this normalizer.
  *
  * @param mixed $data Data to denormalize from.
  * @param string $type The class to which the data should be denormalized.
  * @param string $format The format being deserialized from.
  *
  * @return bool
  */
 public function supportsDenormalization($data, $type, $format = null)
 {
     if ($format == "xml" && $type == FraudFilterRuleCollection::GetClassName()) {
         return true;
     }
     return false;
 }
 private function denormaliseFraudFilter(\ArrayAccess $array)
 {
     $fraudFilterData = $array['fraudresponse'];
     if (!isset($fraudFilterData) || !is_array($fraudFilterData)) {
         return null;
     }
     $data = new SafeArrayAccess($fraudFilterData);
     $ffr = new FraudFilter();
     $ffr->setMode($data['@mode']);
     $ffr->setResult($data['result']);
     $rules = $data['rules'];
     $ffrRules = new FraudFilterRuleCollection();
     if (!empty($rules)) {
         foreach ($rules as $currentRule) {
             // Ensure that $rules is an array of results
             if (isset($currentRule['@id'])) {
                 $currentRule = array(0 => $currentRule);
             }
             foreach ($currentRule as $ffrRule) {
                 $ffrRule = new SafeArrayAccess($ffrRule);
                 $tmpRule = new FraudFilterRule();
                 $tmpRule->setId($ffrRule['@id']);
                 $tmpRule->setName($ffrRule['@name']);
                 $tmpRule->setAction($ffrRule['action']);
                 $ffrRules->add($tmpRule);
             }
         }
         $ffr->setRules($ffrRules);
     }
     return $ffr;
 }