MicrosoftAzureStorageBlobModelsBlobProperties

Represents blob properties.

Defined (1)

The class is defined in the following location(s).

/lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobProperties.php  
  1. class BlobProperties 
  2. /** 
  3. * @var \DateTime 
  4. */ 
  5. private $_lastModified; 
  6.  
  7. /** 
  8. * @var string 
  9. */ 
  10. private $_etag; 
  11.  
  12. /** 
  13. * @var string 
  14. */ 
  15. private $_contentType; 
  16.  
  17. /** 
  18. * @var integer 
  19. */ 
  20. private $_contentLength; 
  21.  
  22. /** 
  23. * @var string 
  24. */ 
  25. private $_contentEncoding; 
  26.  
  27. /** 
  28. * @var string 
  29. */ 
  30. private $_contentLanguage; 
  31.  
  32. /** 
  33. * @var string 
  34. */ 
  35. private $_contentMD5; 
  36.  
  37. /** 
  38. * @var string 
  39. */ 
  40. private $_contentRange; 
  41.  
  42. /** 
  43. * @var string 
  44. */ 
  45. private $_cacheControl; 
  46.  
  47. /** 
  48. * @var string 
  49. */ 
  50. private $_blobType; 
  51.  
  52. /** 
  53. * @var string 
  54. */ 
  55. private $_leaseStatus; 
  56.  
  57. /** 
  58. * @var integer 
  59. */ 
  60. private $_sequenceNumber; 
  61.  
  62. /** 
  63. * Creates BlobProperties object from $parsed response in array representation 
  64. *  
  65. * @param array $parsed parsed response in array format. 
  66. *  
  67. * @return BlobProperties 
  68. */ 
  69. public static function create($parsed) 
  70. $result = new BlobProperties(); 
  71. $clean = array_change_key_case($parsed); 
  72.  
  73. $date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED); 
  74. $result->setBlobType(Utilities::tryGetValue($clean, 'blobtype')); 
  75. $result->setContentLength(intval($clean[Resources::CONTENT_LENGTH])); 
  76. $result->setETag(Utilities::tryGetValue($clean, Resources::ETAG)); 
  77.  
  78. if (!is_null($date)) { 
  79. $date = Utilities::rfc1123ToDateTime($date); 
  80. $result->setLastModified($date); 
  81.  
  82. $result->setLeaseStatus(Utilities::tryGetValue($clean, 'leasestatus')); 
  83. $result->setLeaseStatus( 
  84. Utilities::tryGetValue( 
  85. $clean, Resources::X_MS_LEASE_STATUS, $result->getLeaseStatus() 
  86. ); 
  87. $result->setSequenceNumber( 
  88. intval( 
  89. Utilities::tryGetValue($clean, Resources::X_MS_BLOB_SEQUENCE_NUMBER) 
  90. ); 
  91. $result->setContentRange( 
  92. Utilities::tryGetValue($clean, Resources::CONTENT_RANGE) 
  93. ); 
  94. $result->setCacheControl( 
  95. Utilities::tryGetValue($clean, Resources::CACHE_CONTROL) 
  96. ); 
  97. $result->setBlobType( 
  98. Utilities::tryGetValue( 
  99. $clean, Resources::X_MS_BLOB_TYPE, $result->getBlobType() 
  100. ); 
  101. $result->setContentEncoding( 
  102. Utilities::tryGetValue($clean, Resources::CONTENT_ENCODING) 
  103. ); 
  104. $result->setContentLanguage( 
  105. Utilities::tryGetValue($clean, Resources::CONTENT_LANGUAGE) 
  106. ); 
  107. $result->setContentMD5( 
  108. Utilities::tryGetValue($clean, Resources::CONTENT_MD5) 
  109. ); 
  110. $result->setContentType( 
  111. Utilities::tryGetValue($clean, Resources::CONTENT_TYPE) 
  112. ); 
  113.  
  114. return $result; 
  115.  
  116. /** 
  117. * Gets blob lastModified. 
  118. * @return \DateTime. 
  119. */ 
  120. public function getLastModified() 
  121. return $this->_lastModified; 
  122.  
  123. /** 
  124. * Sets blob lastModified. 
  125. * @param \DateTime $lastModified value. 
  126. * @return none. 
  127. */ 
  128. public function setLastModified($lastModified) 
  129. Validate::isDate($lastModified); 
  130. $this->_lastModified = $lastModified; 
  131.  
  132. /** 
  133. * Gets blob etag. 
  134. * @return string. 
  135. */ 
  136. public function getETag() 
  137. return $this->_etag; 
  138.  
  139. /** 
  140. * Sets blob etag. 
  141. * @param string $etag value. 
  142. * @return none. 
  143. */ 
  144. public function setETag($etag) 
  145. $this->_etag = $etag; 
  146.  
  147. /** 
  148. * Gets blob contentType. 
  149. * @return string. 
  150. */ 
  151. public function getContentType() 
  152. return $this->_contentType; 
  153.  
  154. /** 
  155. * Sets blob contentType. 
  156. * @param string $contentType value. 
  157. * @return none. 
  158. */ 
  159. public function setContentType($contentType) 
  160. $this->_contentType = $contentType; 
  161.  
  162. /** 
  163. * Gets blob contentRange. 
  164. * @return string. 
  165. */ 
  166. public function getContentRange() 
  167. return $this->_contentRange; 
  168.  
  169. /** 
  170. * Sets blob contentRange. 
  171. * @param string $contentRange value. 
  172. * @return none. 
  173. */ 
  174. public function setContentRange($contentRange) 
  175. $this->_contentRange = $contentRange; 
  176.  
  177. /** 
  178. * Gets blob contentLength. 
  179. * @return integer. 
  180. */ 
  181. public function getContentLength() 
  182. return $this->_contentLength; 
  183.  
  184. /** 
  185. * Sets blob contentLength. 
  186. * @param integer $contentLength value. 
  187. * @return none. 
  188. */ 
  189. public function setContentLength($contentLength) 
  190. Validate::isInteger($contentLength, 'contentLength'); 
  191. $this->_contentLength = $contentLength; 
  192.  
  193. /** 
  194. * Gets blob contentEncoding. 
  195. * @return string. 
  196. */ 
  197. public function getContentEncoding() 
  198. return $this->_contentEncoding; 
  199.  
  200. /** 
  201. * Sets blob contentEncoding. 
  202. * @param string $contentEncoding value. 
  203. * @return none. 
  204. */ 
  205. public function setContentEncoding($contentEncoding) 
  206. $this->_contentEncoding = $contentEncoding; 
  207.  
  208. /** 
  209. * Gets blob contentLanguage. 
  210. * @return string. 
  211. */ 
  212. public function getContentLanguage() 
  213. return $this->_contentLanguage; 
  214.  
  215. /** 
  216. * Sets blob contentLanguage. 
  217. * @param string $contentLanguage value. 
  218. * @return none. 
  219. */ 
  220. public function setContentLanguage($contentLanguage) 
  221. $this->_contentLanguage = $contentLanguage; 
  222.  
  223. /** 
  224. * Gets blob contentMD5. 
  225. * @return string. 
  226. */ 
  227. public function getContentMD5() 
  228. return $this->_contentMD5; 
  229.  
  230. /** 
  231. * Sets blob contentMD5. 
  232. * @param string $contentMD5 value. 
  233. * @return none. 
  234. */ 
  235. public function setContentMD5($contentMD5) 
  236. $this->_contentMD5 = $contentMD5; 
  237.  
  238. /** 
  239. * Gets blob cacheControl. 
  240. * @return string. 
  241. */ 
  242. public function getCacheControl() 
  243. return $this->_cacheControl; 
  244.  
  245. /** 
  246. * Sets blob cacheControl. 
  247. * @param string $cacheControl value. 
  248. * @return none. 
  249. */ 
  250. public function setCacheControl($cacheControl) 
  251. $this->_cacheControl = $cacheControl; 
  252.  
  253. /** 
  254. * Gets blob blobType. 
  255. * @return string. 
  256. */ 
  257. public function getBlobType() 
  258. return $this->_blobType; 
  259.  
  260. /** 
  261. * Sets blob blobType. 
  262. * @param string $blobType value. 
  263. * @return none. 
  264. */ 
  265. public function setBlobType($blobType) 
  266. $this->_blobType = $blobType; 
  267.  
  268. /** 
  269. * Gets blob leaseStatus. 
  270. * @return string. 
  271. */ 
  272. public function getLeaseStatus() 
  273. return $this->_leaseStatus; 
  274.  
  275. /** 
  276. * Sets blob leaseStatus. 
  277. * @param string $leaseStatus value. 
  278. * @return none. 
  279. */ 
  280. public function setLeaseStatus($leaseStatus) 
  281. $this->_leaseStatus = $leaseStatus; 
  282.  
  283. /** 
  284. * Gets blob sequenceNumber. 
  285. * @return int. 
  286. */ 
  287. public function getSequenceNumber() 
  288. return $this->_sequenceNumber; 
  289.  
  290. /** 
  291. * Sets blob sequenceNumber. 
  292. * @param int $sequenceNumber value. 
  293. * @return none. 
  294. */ 
  295. public function setSequenceNumber($sequenceNumber) 
  296. Validate::isInteger($sequenceNumber, 'sequenceNumber'); 
  297. $this->_sequenceNumber = $sequenceNumber;