Voice.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. * Voice.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 Voice.
  22. *
  23. * @property string $media_id
  24. */
  25. class Voice extends AbstractMessage
  26. {
  27. /**
  28. * Message type.
  29. *
  30. * @var string
  31. */
  32. protected $type = 'voice';
  33. /**
  34. * Properties.
  35. *
  36. * @var array
  37. */
  38. protected $properties = [
  39. 'media_id',
  40. 'recognition',
  41. ];
  42. /**
  43. * Set media id.
  44. *
  45. * @param string $mediaId
  46. *
  47. * @return Voice
  48. */
  49. public function media($mediaId)
  50. {
  51. $this->setAttribute('media_id', $mediaId);
  52. return $this;
  53. }
  54. }