PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/src/bnetlib/Resource/Entity/Wow/Item/Stat.php

https://github.com/bforchhammer/bnetlib
PHP | 101 lines | 38 code | 12 blank | 51 comment | 0 complexity | 0730d60dd72ab14969e4b8e44d2f69be MD5 | raw file
  1. <?php
  2. /**
  3. * This file is part of the bnetlib Library.
  4. * Copyright (c) 2012 Eric Boh <cossish@gmail.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code. You can also view the
  8. * LICENSE file online at http://coss.github.com/bnetlib/license.html
  9. *
  10. * @category bnetlib
  11. * @package Resource
  12. * @subpackage WorldOfWarcraft
  13. * @copyright 2012 Eric Boh <cossish@gmail.com>
  14. * @license http://coss.gitbub.com/bnetlib/license.html MIT License
  15. */
  16. namespace bnetlib\Resource\Entity\Wow\Item;
  17. use bnetlib\Resource\Entity\EntityInterface;
  18. use bnetlib\ServiceLocator\ServiceLocatorInterface;
  19. /**
  20. * @category bnetlib
  21. * @package Resource
  22. * @subpackage WorldOfWarcraft
  23. * @copyright 2012 Eric Boh <cossish@gmail.com>
  24. * @license http://coss.gitbub.com/bnetlib/license.html MIT License
  25. */
  26. class Stat implements EntityInterface
  27. {
  28. /**
  29. * @var array
  30. */
  31. protected $data = array();
  32. /**
  33. * @var array|null
  34. */
  35. protected $headers;
  36. /**
  37. * @var ServiceLocatorInterface
  38. */
  39. protected $serviceLocator;
  40. /**
  41. * @inheritdoc
  42. */
  43. public function populate($data)
  44. {
  45. $this->data = $data;
  46. }
  47. /**
  48. * @inheritdoc
  49. */
  50. public function getResponseHeaders()
  51. {
  52. return $this->headers;
  53. }
  54. /**
  55. * @inheritdoc
  56. */
  57. public function setResponseHeaders($headers)
  58. {
  59. $this->headers = $headers;
  60. }
  61. /**
  62. * @inheritdoc
  63. */
  64. public function setServiceLocator(ServiceLocatorInterface $locator)
  65. {
  66. $this->serviceLocator = $locator;
  67. }
  68. /**
  69. * @return integer
  70. */
  71. public function getId()
  72. {
  73. return $this->data['stat'];
  74. }
  75. /**
  76. * @return integer
  77. */
  78. public function getAmount()
  79. {
  80. return $this->data['amount'];
  81. }
  82. /**
  83. * @return boolean
  84. */
  85. public function isReforged()
  86. {
  87. return $this->data['reforged'];
  88. }
  89. }