审查视图

vendor/overtrue/wechat/src/Message/Voice.php 1.0 KB
王智 authored
1 2 3 4 5 6 7 8 9 10 11 12
<?php

/*
 * This file is part of the overtrue/wechat.
 *
 * (c) overtrue <i@overtrue.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

/**
王智 authored
13
 * Voice.php.
王智 authored
14 15 16 17 18 19 20 21
 *
 * @author    overtrue <i@overtrue.me>
 * @copyright 2015 overtrue <i@overtrue.me>
 *
 * @see      https://github.com/overtrue
 * @see      http://overtrue.me
 */
王智 authored
22
namespace EasyWeChat\Message;
王智 authored
23 24

/**
王智 authored
25 26 27
 * Class Voice.
 *
 * @property string $media_id
王智 authored
28
 */
王智 authored
29
class Voice extends AbstractMessage
王智 authored
30 31 32 33 34 35
{
    /**
     * Message type.
     *
     * @var string
     */
王智 authored
36
    protected $type = 'voice';
王智 authored
37 38 39 40 41 42

    /**
     * Properties.
     *
     * @var array
     */
王智 authored
43 44 45 46
    protected $properties = [
                                'media_id',
                                'recognition',
                            ];
王智 authored
47 48

    /**
王智 authored
49 50 51
     * Set media id.
     *
     * @param string $mediaId
王智 authored
52
     *
王智 authored
53
     * @return Voice
王智 authored
54
     */
王智 authored
55
    public function media($mediaId)
王智 authored
56
    {
王智 authored
57 58 59
        $this->setAttribute('media_id', $mediaId);

        return $this;
王智 authored
60 61
    }
}