예제 #1
0
 /**
  * @test
  */
 public function testArray_match_key()
 {
     $arr = array('key1' => 'somevalue', 'key2' => 'someothervalue');
     $this->assertEquals(PPUtils::array_match_key($arr, "key"), true);
     $arr = unserialize('a:10:{s:26:"responseEnvelope.timestamp";s:35:"2011-04-19T04%3A32%3A29.469-07%3A00";s:20:"responseEnvelope.ack";s:7:"Failure";s:30:"responseEnvelope.correlationId";s:13:"c2514f258ddf1";s:22:"responseEnvelope.build";s:7:"1829457";s:16:"error(0).errorId";s:6:"580027";s:15:"error(0).domain";s:8:"PLATFORM";s:17:"error(0).severity";s:5:"Error";s:17:"error(0).category";s:11:"Application";s:16:"error(0).message";s:44:"Prohibited+request+parameter%3A+businessInfo";s:21:"error(0).parameter(0)";s:12:"businessInfo";}');
     $this->assertEquals(PPUtils::array_match_key($arr, "error(0)."), true);
 }
예제 #2
0
 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++;
         }
     }
 }
예제 #3
0
 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);
             }
         }
     }
 }
예제 #4
0
파일: Invoice.php 프로젝트: kashyapkk/SDKs
 public function init($map = null, $prefix = '')
 {
     if ($map != null) {
         $mapKeyName = $prefix . 'viaPayPal';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->viaPayPal = $map[$mapKeyName];
         }
         if (PPUtils::array_match_key($map, $prefix . "paypalPayment.")) {
             $newPrefix = $prefix . "paypalPayment.";
             $this->paypalPayment = new PayPalPaymentRefundDetailsType();
             $this->paypalPayment->init($map, $newPrefix);
         }
         if (PPUtils::array_match_key($map, $prefix . "otherPayment.")) {
             $newPrefix = $prefix . "otherPayment.";
             $this->otherPayment = new OtherPaymentRefundDetailsType();
             $this->otherPayment->init($map, $newPrefix);
         }
     }
 }
예제 #5
0
 public function init($map = null, $prefix = '')
 {
     if ($map != null) {
         $mapKeyName = $prefix . 'emailAddress';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->emailAddress = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'accountType';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->accountType = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'accountId';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->accountId = $map[$mapKeyName];
         }
         if (PPUtils::array_match_key($map, $prefix . "name.")) {
             $newPrefix = $prefix . "name.";
             $this->name = new NameType();
             $this->name->init($map, $newPrefix);
         }
         $mapKeyName = $prefix . 'businessName';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->businessName = $map[$mapKeyName];
         }
     }
 }