发送邮件
@return boolean
353146
public function send()
    {
        $mail = new PHPMailer();
        $mail->IsSMTP(); // telling the class to use SMTP

        $mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
        // 1 = errors and messages
        // 2 = messages only
        $mail->Host     = $this->smtp_host; // SMTP server
        $mail->Username = $this->smtp_user; // SMTP account username
        $mail->Password = $this->smtp_pass; // SMTP account password
        $mail->Port     = $this->smtp_port;

        $mail->SetFrom($this->from, $this->from_name);
        $mail->Subject = $this->subject; //邮件标题
        $mail->MsgHTML($this->message); //邮件内容

        // 收件人列表
        $count_to = count($this->to);
        for ($i = 0; $i < $count_to; $i++) {
            $mail->AddAddress($this->to[$i]);
        }

        // cc
        $count_cc = count($this->cc);
        for ($i = 0; $i < $count_cc; $i++) {
            $mail->AddCC($this->cc[$i]);
        }

        // bcc
        $count_bcc = count($this->bcc);
        for ($i = 0; $i < $count_bcc; $i++) {
            $mail->AddBCC($this->bcc[$i]);
        }

        // 附件列表
        $count_attach = count($this->attach);
        for ($j = 0; $j < $count_attach; $j++) {
            $mail->AddAttachment($this->attach[$j]);
        }

        if ($mail->Send()) {
            return true;
        } else {
            return array('message' => $mail->ErrorInfo);
        }
    }
146581
public function save()
    {
        /**
         * 使用PHP Sesion，Readonl，未启动 这3种情况下不需要保存
         */
        if ($this->use_php_session or !$this->isStart or $this->readonly)
        {
            return true;
        }
        //设置为Session关闭状态
        $this->isStart = false;
        $key = self::$cache_prefix . $this->sessID;
        return $this->cache->set($key, serialize($_SESSION), $this->session_lifetime);
    }
54255
public function exists()
    {
        if (! array_key_exists($this->primaryKey, $this->attributes)) {
            return false;
        }

        return ! empty($this->attributes[$this->primaryKey]);
    }
821954
private function init()
    {
        // 创建项目缓存目录
        if (!is_dir($this->options['path'])) {
            if (mkdir($this->options['path'], 0755, true)) {
                return true;
            }
        }
        return false;
    }
1284950
public function valid()
	{
		if(!isset($this->lines[$this->position])){
			return false;
		}
		if(count($this->lines[$this->position])===0){
			return false;
		}
		return true;
	}
500980
public function authRoleDelete()
    {
        $roleCount = AuthRoleUser::where(['role_id'=>$this->id])->count();
        if($roleCount > 0){
            return "已有{$roleCount}用户在是有此角色不可删除";
        }

        if($this->delete()){
            if($this->authAccess){
                AuthAccess::where(['role_id'=>$this->id,'type'=>'admin_url'])->delete();
            }
            return true;
        }
        return false;
    }
762805
public function isString()
    {
        return $this->data_type === PDO::PARAM_STR ||
            $this->data_type === (PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT);
    }
93463
public function validate(): bool
    {
        $valid = true;
        foreach ($this->_responses as $key => $response) {
            if ($response === null) {
                continue;
            }
            if (!$response->validate()) {
                $valid = false;
            }
        }
        return $valid && empty($this->_errors);
    }
1085664
public function valid()
    {
        if (key($this->_data) === null) {
            return false;
        }

        $current = current($this->_data);
        while (!$current->value()) {
            $current = $this->next();
            if (key($this->_data) === null) {
                return false;
            }
        }
        return true;
    }
20882
function save()
    {
        $this->_save = false;
        if ($this->_change == 0 or $this->_change == 1)
        {
            if ($this->db->insert($this->_data, $this->table) === false)
            {
                return false;
            }
            //改变状态
            $this->_change = 1;
            $this->_current_id = $this->db->lastInsertId();
        }
        elseif ($this->_change == 2)
        {
            $update = $this->_update;
            unset($update[$this->primary]);
            if ($this->db->update($this->_current_id, $update, $this->table, $this->primary) === false)
            {
                return false;
            }
        }
        $this->notify();
        return true;
    }
1085324
public function isValid() {
		
		$value = $this -> getValue();

		if(true === $this -> getValidateAsArray() && true === is_array($value)) {
			
			foreach($value as $val) {

				if(false === $this -> check($val)) {
					return false;
				}
			}
		}
		else {
			return $this -> check($value);
		}

		return true;
	}
1215974
public function valid()
    {
        if (!isset($this->keys[$this->position])) {
            return false;
        }

        $currentKey = $this->keys[$this->position];

        return isset($this->items[$currentKey]);
    }
1311509
public function isPing()
    {
        $nowTime = time();
        // 心跳间隔时间
        $pingInteralTime = RabbitMqConfig::getCommon('rabbit_mq_ping_interval_time');
        if ($this->lastPingTime + $pingInteralTime < $nowTime) {
            $this->lastPingTime = $nowTime;
            return true;
        }
        return false;
    }
1261635
public function isValid() {
        if($this->isRequired()) {
            if($this->getValue() == null) return false;
            if($this->getValue() == "") return false;
        }
        return true;
    }
659589
public function start() {
        if ($this->dialect) {
            //允许事务嵌套
            $this->transLevel += 1;
            $dialect          = $this->dialect;
            if ($dialect->inTransaction()) {
                return true;
            }
            $rst = $dialect->beginTransaction();
            if ($rst) {
                return true;
            } else {
                $this->transLevel -= 1;
            }
        }

        return false;
    }
932048
public function validate()
    {
        $errors = [];

        foreach ($this->fields as $field) {
            $result = $field->validate();

            if ($result->isFailure()) {
                $errors[] = $result;
            }
        }

        if ($errors) {
            $this->setErrors($errors);

            return false;
        }

        return true;
    }
982319
public function validate()
    {
        if (is_numeric($this->categoryId) && $this->categoryId >= 1
                && is_numeric($this->forumId) && $this->forumId >= 1
                && is_numeric($this->threadId) && $this->threadId >= 1
                && !empty($this->threadSlug)) {
            return true;
        }
        return false;
    }