BxDolVoteStarsQuery.php 654 B

12345678910111213141516171819202122232425262728
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. /**
  10. * @see BxDolVote
  11. */
  12. class BxDolVoteStarsQuery extends BxDolVoteQuery
  13. {
  14. public function __construct(&$oModule)
  15. {
  16. parent::__construct($oModule);
  17. }
  18. public function getLegend($iObjectId)
  19. {
  20. $sQuery = $this->prepare("SELECT `value` AS `value`, COUNT(`value`) AS `count` FROM `{$this->_sTableTrack}` WHERE `object_id` = ? GROUP BY `value`", $iObjectId);
  21. return $this->getAllWithKey($sQuery, 'value');
  22. }
  23. }
  24. /** @} */