You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
1.2 KiB

  1. <?php
  2. /*
  3. * This file is part of the overtrue/wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. /**
  11. * Music.php.
  12. *
  13. * @author overtrue <i@overtrue.me>
  14. * @copyright 2015 overtrue <i@overtrue.me>
  15. *
  16. * @see https://github.com/overtrue
  17. * @see http://overtrue.me
  18. */
  19. namespace EasyWeChat\Message;
  20. /**
  21. * Class Music.
  22. *
  23. * @property string $url
  24. * @property string $hq_url
  25. * @property string $title
  26. * @property string $description
  27. * @property string $thumb_media_id
  28. * @property string $format
  29. */
  30. class Music extends AbstractMessage
  31. {
  32. /**
  33. * Message type.
  34. *
  35. * @var string
  36. */
  37. protected $type = 'music';
  38. /**
  39. * Properties.
  40. *
  41. * @var array
  42. */
  43. protected $properties = [
  44. 'title',
  45. 'description',
  46. 'url',
  47. 'hq_url',
  48. 'thumb_media_id',
  49. 'format',
  50. ];
  51. /**
  52. * 设置音乐封面.
  53. *
  54. * @param string $mediaId
  55. *
  56. * @return $this
  57. */
  58. public function thumb($mediaId)
  59. {
  60. $this->setAttribute('thumb_media_id', $mediaId);
  61. return $this;
  62. }
  63. }