Esempio n. 1
0
 /**
  * Creates BatchError object.
  * 
  * @param MicrosoftAzure\Storage\Common\ServiceException $error   The error object.
  * @param array                                $headers The response headers.
  * 
  * @return \MicrosoftAzure\Storage\Table\Models\BatchError 
  */
 public static function create($error, $headers)
 {
     Validate::isTrue($error instanceof ServiceException, Resources::INVALID_EXC_OBJ_MSG);
     Validate::isArray($headers, 'headers');
     $result = new BatchError();
     $clean = array_change_key_case($headers);
     $result->setError($error);
     $contentId = Utilities::tryGetValue($clean, Resources::CONTENT_ID);
     $result->setContentId(is_null($contentId) ? null : intval($contentId));
     return $result;
 }