SmsModel::sendMessage PHP Method

sendMessage() public method

发送短息消息
Author: Medz Seven ([email protected])
public sendMessage ( integer $phone, string $message, boolean $sendLock = false ) : boolean
$phone integer 手机号码
$message string 短信内容
$sendLock boolean 时间锁, 默认关闭
return boolean
    public function sendMessage($phone, $message, $sendLock = false)
    {
        $this->phone = $phone;
        $this->template = $message;
        /* # 前置必要条件检查 */
        if (!$this->allBefore()) {
            return false;
            /* # 锁检查 */
        } elseif ($sendLock and $this->lock()) {
            return false;
        }
        $this->buildParam();
        $this->InLock();
        if ($result = $this->send()) {
            $this->add(array('phone' => $this->phone, 'message' => $this->template, 'time' => time()));
        }
        return $result;
    }