Esempio n. 1
0
 /**
  * End request - update log
  *
  * @param int $id
  * @param Response $response
  */
 public static function endRequest($id, Response $response)
 {
     $data = array('status' => $response->isSuccess() ? self::STATUS_SUCCESS : self::STATUS_FAIL, 'error_count' => count($response->getErrors()), 'warning_count' => count($response->getWarnings()), 'success_rate' => $response->getSuccessRate(), 'end_datetime' => time());
     db_query('UPDATE ?:ebay_transaction_log SET ?u WHERE id = ?i', $data, $id);
 }
Esempio n. 2
0
 /**
  * @param Product $product
  * @param Response $response
  * @param int $action
  */
 protected static function checkResponse(Product $product, Response $response, $action)
 {
     $errors = $response->getErrors();
     $warnings = $response->getWarnings();
     foreach ($errors as $error) {
         ProductLogger::error($action, $product, $error['message'], $error['code']);
         static::setError($error['code'], $error['message']);
     }
     foreach ($warnings as $warning) {
         ProductLogger::warning($action, $product, $warning['message'], $warning['code']);
     }
 }