/** * @test */ public function deserializationTest() { $this->map = array('responseEnvelope.ack' => 'Success', 'responseEnvelope.timestamp' => '2011-05-29T23%3A58%3A46.879-07%3A00', 'responseEnvelope.correlationId' => '2eba4859262a9', 'responseEnvelope.build' => '1917403'); $this->object = new ResponseEnvelope(); $this->object->init($this->map, 'responseEnvelope.'); $this->assertEquals('Success', $this->object->ack); $this->assertEquals('1917403', $this->object->build); $this->assertEquals('2eba4859262a9', $this->object->correlationId); $this->assertEquals('2011-05-29T23:58:46.879-07:00', $this->object->timestamp); }
public function init($map = null, $prefix = '') { if ($map != null) { if (PPUtils::array_match_key($map, $prefix . "responseEnvelope.")) { $newPrefix = $prefix . "responseEnvelope."; $this->responseEnvelope = new ResponseEnvelope(); $this->responseEnvelope->init($map, $newPrefix); } $i = 0; while (true) { if (PPUtils::array_match_key($map, $prefix . "userLimit({$i})")) { $newPrefix = $prefix . "userLimit({$i})."; $this->userLimit[$i] = new UserLimit(); $this->userLimit[$i]->init($map, $newPrefix); } else { break; } $i++; } if (PPUtils::array_match_key($map, $prefix . "warningDataList.")) { $newPrefix = $prefix . "warningDataList."; $this->warningDataList = new WarningDataList(); $this->warningDataList->init($map, $newPrefix); } $i = 0; while (true) { if (PPUtils::array_match_key($map, $prefix . "error({$i})")) { $newPrefix = $prefix . "error({$i})."; $this->error[$i] = new ErrorData(); $this->error[$i]->init($map, $newPrefix); } else { break; } $i++; } } }
public function init($map = null, $prefix = '') { if ($map != null) { if (PPUtils::array_match_key($map, $prefix . "responseEnvelope.")) { $newPrefix = $prefix . "responseEnvelope."; $this->responseEnvelope = new ResponseEnvelope(); $this->responseEnvelope->init($map, $newPrefix); } $mapKeyName = $prefix . 'invoiceID'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->invoiceID = $map[$mapKeyName]; } $mapKeyName = $prefix . 'invoiceNumber'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->invoiceNumber = $map[$mapKeyName]; } $mapKeyName = $prefix . 'invoiceURL'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->invoiceURL = $map[$mapKeyName]; } $i = 0; while (true) { if (PPUtils::array_match_key($map, $prefix . "error({$i})")) { $newPrefix = $prefix . "error({$i})."; $this->error[$i] = new ErrorData(); $this->error[$i]->init($map, $newPrefix); } else { break; } $i++; } } }
public function init($map = null, $prefix = '') { if ($map != null) { if (PPUtils::array_match_key($map, $prefix . "responseEnvelope.")) { $newPrefix = $prefix . "responseEnvelope."; $this->responseEnvelope = new ResponseEnvelope(); $this->responseEnvelope->init($map, $newPrefix); } for ($i = 0; $i < 10; $i++) { if (PPUtils::array_match_key($map, $prefix . "error({$i})")) { $newPrefix = $prefix . "error({$i})."; $this->error[$i] = new ErrorData(); $this->error[$i]->init($map, $newPrefix); } } } }