Esempio n. 1
0
 public function setData($params)
 {
     foreach ($params as $property => $value) {
         if (property_exists($this, $property)) {
             if (is_array($this->{$property})) {
                 $this->{$property} = array_merge($this->{$property}, $value);
             } else {
                 $this->{$property} = $value;
             }
         }
     }
     //        var_dump($this->ePrices);die;
     $this->_wsdl_uri = isset($params['method']) ? $params[$params['method'] . '_wsdl_uri'] : $this->_wsdl_uri;
     $puser = new PartProviderUserSearch();
     $p = $puser->getUserProvider(['store_id' => $params['store_id'], 'provider_id' => $this->id]);
     if ($p->count > 0) {
         $this->login = $p->models[0]->attributes['login'];
         $this->store_id = $p->models[0]->attributes['store_id'];
         $this->password = $p->models[0]->attributes['password'];
         $this->marga = $p->models[0]->attributes['marga'] / 100 + 1;
         $this->srokdays = $p->models[0]->srok;
         $this->find = true;
     } else {
         $this->find = false;
     }
 }