Image.php 945 B

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