Exemplo n.º 1
0
 /**
  * [__construct description]
  * @param [Array] $multirequest    indexed array containing quotation information, namely "from", "to", "parcels" and "additional_params"
  */
 public function __construct($multirequest)
 {
     parent::__construct();
     foreach ($multirequest as $quot_index => $quot_info) {
         // set additional params
         $params = $quot_info['additional_params'];
         // Set sender
         foreach ($quot_info['from'] as $key => $value) {
             $params['expediteur.' . $key] = $value;
         }
         // Set recipient
         foreach ($quot_info['to'] as $key => $value) {
             $params['destinataire.' . $key] = $value;
         }
         // Set parcel
         foreach ($quot_info['parcels']['dimensions'] as $d => $data) {
             $params[$quot_info['parcels']['type'] . '_' . $d . '.poids'] = $data['poids'];
             $params[$quot_info['parcels']['type'] . '_' . $d . '.longueur'] = $data['longueur'];
             $params[$quot_info['parcels']['type'] . '_' . $d . '.largeur'] = $data['largeur'];
             $params[$quot_info['parcels']['type'] . '_' . $d . '.hauteur'] = $data['hauteur'];
         }
         $this->setParamMulti($params);
     }
 }