Option.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Review\Model\Rating;
  7. /**
  8. * Rating option model
  9. *
  10. * @api
  11. * @method int getRatingId()
  12. * @method \Magento\Review\Model\Rating\Option setRatingId(int $value)
  13. * @method string getCode()
  14. * @method \Magento\Review\Model\Rating\Option setCode(string $value)
  15. * @method int getValue()
  16. * @method \Magento\Review\Model\Rating\Option setValue(int $value)
  17. * @method int getPosition()
  18. * @method \Magento\Review\Model\Rating\Option setPosition(int $value)
  19. *
  20. * @author Magento Core Team <core@magentocommerce.com>
  21. * @codeCoverageIgnore
  22. * @since 100.0.2
  23. */
  24. class Option extends \Magento\Framework\Model\AbstractModel
  25. {
  26. /**
  27. * @return void
  28. */
  29. protected function _construct()
  30. {
  31. $this->_init(\Magento\Review\Model\ResourceModel\Rating\Option::class);
  32. }
  33. /**
  34. * @return $this
  35. */
  36. public function addVote()
  37. {
  38. $this->getResource()->addVote($this);
  39. return $this;
  40. }
  41. /**
  42. * @param mixed $id
  43. * @return $this
  44. */
  45. public function setId($id)
  46. {
  47. $this->setOptionId($id);
  48. return $this;
  49. }
  50. }