回复规则匹配
@return array|mixed
516890
public function match()
    {
        if ($this->message['MsgType'] == 'event') { // 事件
            $method = 'matchEvent' . $this->message['Event'];
        } else {
            $method = 'match' . $this->message['MsgType'];
        }
        $matches = [];
        if (method_exists($this, $method)) {
            $matches = call_user_func([$this, $method]);
        }
        $matches = array_merge([
            ['route' => '/wechat/process/fans/record'] // 记录常用数据
        ], $matches);

        Yii::info($matches, __METHOD__);
        return $matches;
    }
210268
public function query()
    {

        $query = [];

        $query["index"] = $this->getIndex();

        if ($this->getType()) {
            $query["type"] = $this->getType();
        }

        if ($this->model && $this->useGlobalScopes) {
            $this->model->boot($this);
        }

        $query["body"] = $this->getBody();

        $query["from"] = $this->getSkip();

        $query["size"] = $this->getTake();

        if (count($this->ignores)) {
            $query["client"] = ['ignore' => $this->ignores];
        }

        $search_type = $this->getSearchType();

        if ($search_type) {
            $query["search_type"] = $search_type;
        }

        $scroll = $this->getScroll();

        if ($scroll) {
            $query["scroll"] = $scroll;
        }

        return $query;
    }
797572
public function toArray()
    {
        $array = [];

        if (!empty($this->getBefore())) {
            $array['before'] = [];
            foreach ($this->getBefore() as $beforeAction) {
                $array['before'][] = $beforeAction->toArray();
            }
        }

        if (!empty($this->getAfter())) {
            $array['after'] = [];
            foreach ($this->getAfter() as $afterAction) {
                $array['after'][] = $afterAction->toArray();
            }
        }

        return $array;
    }
1044519
public function getData()
    {
        $return = [];

        foreach ($this->collections as $collection) {
            $return[$collection->name()] = $collection->items();
        }

        if (count($this->dump) != 0) {
            $return['dump'] = $this->dump;
        }

        return $return;
    }
861356
public static function get() {

        $keys = func_get_args();
        $config = self::getConfig();
        $value = $config;

        if (!empty($config) && !empty($keys)) {

            foreach ($keys as $number => $name) {

                if (is_object($value)) {

                    $value = Format::objectToArray($value);
                }

                if ($number == 0 && isset($value[$name])) {

                    $value = $value[$keys[0]];
                } else if ($number != 0 && isset($value[$name])) {

                    $value = $value[$name];
                } else {

                    return false;
                }
            }

            return $value;
        } else if (!empty($config)) {

            return $config;
        }

        return false;
    }
978965
public function get_headers()
	{
		$headers = array();
		foreach ($this->headers as $key => $value)
		{
			$headers[] = is_int($key) ? $value : $key.': '.$value;
		}

		return $headers;
	}
835347
public function get()
    {
        $this->_messages = $this->getSession()->get('_messages_', []);
        $messages = $this->_messages;
        $this->flush();
        return $messages;
    }
1328512
public function fetch()
	{
		if(count($this->select->getColumns()) === 0)
		{
			/** @var Column $column */
			$column = $this->factory->references('Column', '*');
			$this->select->column($column);
		}
		$query    = $this->factory->builder($this->select)->process();
		$queryObj = $this->pdo->query($query);
		if($queryObj)
		{
			return $queryObj->fetchAll(\PDO::FETCH_ASSOC);
		}

		return array();
	}
455191
public function select(): array
    {
        //生成请求游标
        $cursor = call_user_func_array([
            $this->collection,
            'find'
        ], func_get_args());

        //逐条取出结果,构造数组
        $result = [];
        while ($cursor->hasNext()) {
            $result[] = $cursor->getNext();
        }

        return $result;
    }
1136382
public function query()
    {
        $model       = $this->model;

        $this->query = $model->select($this->select)
                            ->where($this->where)
                            ->orderBy($this->orderBy, $this->sortBy)
                            ->take($this->num)
                            ->offset($this->offset);

        $this->sql   = $this->query->getQuery()->toSql();

        $this->data  = $this->query->get()->toArray();

        return $this->data;
    }
486288
public function get()
    {
        $parameters = [];
        foreach ($this->parameters as $parameter) {
            $parameters[] = $parameter->get();
        }

        return [
            'type' => 'new',
            'class' => $this->className,
            'parameters' => $parameters,
            'dynamic' => $this->dynamic,
            'file' => $this->file,
            'line' => $this->line,
            'char' => $this->char,
        ];
    }
466543
public function getValues() : array
    {
        $values = [];

        foreach ($this->inputs as $input) {
            $values[] = $input->getValue();
        }

        return $values;
    }
753261
public function getServices()
	{
		$services = false;
		if (!empty($this->cache) && Yii::$app->has($this->cache)) {
			/** @var $cache \yii\caching\Cache */
			$cache = Yii::$app->get($this->cache);
			$services = $cache->get('EAuth.services');
		}

		if (false === $services || !is_array($services)) {
			$services = [];
			foreach ($this->services as $service => $options) {
				/** @var $class ServiceBase */
				$class = $this->getIdentity($service);
				$services[$service] = (object)[
					'id' => $class->getServiceName(),
					'title' => $class->getServiceTitle(),
					'type' => $class->getServiceType(),
					'jsArguments' => $class->getJsArguments(),
				];
			}
			if (isset($cache)) {
				$cache->set('EAuth.services', $services, $this->cacheExpire);
			}
		}
		return $services;
	}
1147638
public function get(): array
    {
        $data = [];

        foreach ($this->data as $row) {
            $data[] = $row->get();
        }

        return $data;
    }
822576
public function toArray()
    {
        return array(
            'id' => $this->id,
            'section' => $this->section,
            'title' => $this->title,
            'description' => $this->description,
            'position' => $this->position
        );
    }
902901
public function getFields()
    {
        $fields = array();
        if (isset($this->definition['index'])) {
            $fields[] = $this->getIndex();
        }
        if (isset($this->definition['fields'])) {
            foreach ($this->definition['fields'] as $key => $value) {
                if (!is_numeric($key)) {
                    $fields[] = $key;
                } else {
                    $fields[] = $value;
                }
            }
        }
        return $fields;
    }
941213
public function toArray() {

        return [
            'uid' => $this->uid,
            'method' => $this->method,
            'parameters' => $this->parameters,
            'special_types' => $this->special_types,
            'id' => $this->id
        ];

    }