/** * @param array $adverts of Advert * @return mixed * @throws OtomotoException */ public function advertSave(array $adverts) { try { $result = $this->client->AdvertSave(array('request' => array('Username' => $this->username, 'AutorizationKey' => $this->generateKey(), 'Advert' => $adverts))); if (!$result->AdvertSaveResult->IsOk) { throw new OtomotoException($result->AdvertSaveResult->Message); } return $result; } catch (\Exception $e) { throw new OtomotoException($e->getMessage(), $e->getCode()); } }