PageRenderTime 42ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/backwpup/sdk/WindowsAzure/Table/Models/QueryEntitiesResult.php

https://bitbucket.org/cesarmedrano/cesarmedrano
PHP | 150 lines | 49 code | 16 blank | 85 comment | 0 complexity | 0918cce2285c227440c1b514ba82cea5 MD5 | raw file
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package WindowsAzure\Table\Models
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright 2012 Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/windowsazure/azure-sdk-for-php
  22. */
  23. namespace WindowsAzure\Table\Models;
  24. use WindowsAzure\Common\Internal\Utilities;
  25. use WindowsAzure\Common\Internal\Resources;
  26. /**
  27. * Holds results of calling queryEntities API
  28. *
  29. * @category Microsoft
  30. * @package WindowsAzure\Table\Models
  31. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  32. * @copyright 2012 Microsoft Corporation
  33. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  34. * @version Release: @package_version@
  35. * @link https://github.com/windowsazure/azure-sdk-for-php
  36. */
  37. class QueryEntitiesResult
  38. {
  39. /**
  40. * @var Query
  41. */
  42. private $_nextRowKey;
  43. /**
  44. * @var string
  45. */
  46. private $_nextPartitionKey;
  47. /**
  48. * @var array
  49. */
  50. private $_entities;
  51. /**
  52. * Creates new QueryEntitiesResult instance.
  53. *
  54. * @param array $headers The HTTP response headers.
  55. * @param array $entities The entities.
  56. *
  57. * @return QueryEntitiesResult
  58. */
  59. public static function create($headers, $entities)
  60. {
  61. $result = new QueryEntitiesResult();
  62. $headers = array_change_key_case($headers);
  63. $nextPK = Utilities::tryGetValue(
  64. $headers, Resources::X_MS_CONTINUATION_NEXTPARTITIONKEY
  65. );
  66. $nextRK = Utilities::tryGetValue(
  67. $headers, Resources::X_MS_CONTINUATION_NEXTROWKEY
  68. );
  69. $result->setEntities($entities);
  70. $result->setNextPartitionKey($nextPK);
  71. $result->setNextRowKey($nextRK);
  72. return $result;
  73. }
  74. /**
  75. * Gets entities.
  76. *
  77. * @return array
  78. */
  79. public function getEntities()
  80. {
  81. return $this->_entities;
  82. }
  83. /**
  84. * Sets entities.
  85. *
  86. * @param array $entities The entities array.
  87. *
  88. * @return none
  89. */
  90. public function setEntities($entities)
  91. {
  92. $this->_entities = $entities;
  93. }
  94. /**
  95. * Gets entity next partition key.
  96. *
  97. * @return string
  98. */
  99. public function getNextPartitionKey()
  100. {
  101. return $this->_nextPartitionKey;
  102. }
  103. /**
  104. * Sets entity next partition key.
  105. *
  106. * @param string $nextPartitionKey The entity next partition key value.
  107. *
  108. * @return none
  109. */
  110. public function setNextPartitionKey($nextPartitionKey)
  111. {
  112. $this->_nextPartitionKey = $nextPartitionKey;
  113. }
  114. /**
  115. * Gets entity next row key.
  116. *
  117. * @return string
  118. */
  119. public function getNextRowKey()
  120. {
  121. return $this->_nextRowKey;
  122. }
  123. /**
  124. * Sets entity next row key.
  125. *
  126. * @param string $nextRowKey The entity next row key value.
  127. *
  128. * @return none
  129. */
  130. public function setNextRowKey($nextRowKey)
  131. {
  132. $this->_nextRowKey = $nextRowKey;
  133. }
  134. }