Ejemplo n.º 1
0
 /**
  * @param array $options
  */
 public function __construct(array $options)
 {
     $this->soap = SOAP::Client(Service_Yandex_Direct::option('wsdl'), array_merge($options, array('features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'trace' => 1)));
     if (empty($options['local_cert']) && !empty($options['login']) && !empty($options['token']) && !empty($options['application_id'])) {
         $headers = array();
         $headers[] = new SoapHeader(Service_Yandex_Direct::option('wsdl'), 'login', $options['login']);
         $headers[] = new SoapHeader(Service_Yandex_Direct::option('wsdl'), 'token', $options['token']);
         $headers[] = new SoapHeader(Service_Yandex_Direct::option('wsdl'), 'application_id', $options['application_id']);
         $this->soap->__setSoapHeaders($headers);
     }
 }