获取关键字列表,根据匹配类型区分

@return array
356453
public function getKeywordList()
    {
        $data = [static::EXACT_MATCH => [], static::PARTIAL_MATCH => []];

        $replies = $this->__invoke()->select('id, keywords, matchType')->notDeleted()->notReserved()->fetchAll();

        foreach ($replies as $reply) {
            $keywords = explode(' ', $reply['keywords']);
            foreach ($keywords as $keyword) {
                $data[$reply['matchType']][strtolower($keyword)] = $reply['id'];
            }
        }

        return $data;
    }
525984
public static function GetPdoParamList () {
		return [
			//数値
			'int'				=> \PDO::PARAM_INT,
			'double'			=> \PDO::PARAM_INT,
			'tinyint'			=> \PDO::PARAM_INT,
			'smallint'			=> \PDO::PARAM_INT,
			'mediumint'			=> \PDO::PARAM_INT,
			'bigint'			=> \PDO::PARAM_INT,
			'float'				=> \PDO::PARAM_STR,
			'double'			=> \PDO::PARAM_STR,
			'double precision'	=> \PDO::PARAM_STR,
			'real'				=> \PDO::PARAM_STR,
			'decimal'			=> \PDO::PARAM_STR,
			'dec'				=> \PDO::PARAM_STR,
			'numeric'			=> \PDO::PARAM_STR,
			'fixed'				=> \PDO::PARAM_STR,
			'bit'				=> \PDO::PARAM_INT,
			//真偽値
			'bool'				=> \PDO::PARAM_BOOL,
			'boolean'			=> \PDO::PARAM_BOOL,
			//日付・時刻
			'datetime'			=> \PDO::PARAM_STR,
			'date'				=> \PDO::PARAM_STR,
			'time'				=> \PDO::PARAM_STR,
			'year'				=> \PDO::PARAM_STR,
			'timestamp'			=> \PDO::PARAM_INT,
			//文字・文字列
			'char'				=> \PDO::PARAM_STR,
			'varchar'			=> \PDO::PARAM_STR,
			'text'				=> \PDO::PARAM_STR,
			'mediumtext'		=> \PDO::PARAM_STR,
			'longtext'			=> \PDO::PARAM_STR,
			'national char'		=> \PDO::PARAM_STR,
			'nchar'				=> \PDO::PARAM_STR,
			'character'			=> \PDO::PARAM_STR,
			'tinytext'			=> \PDO::PARAM_STR,
			//バイナリ
			'binary'			=> \PDO::PARAM_LOB,
			'varbinary'			=> \PDO::PARAM_LOB,
			'blob'				=> \PDO::PARAM_LOB,
			'mediumblob'		=> \PDO::PARAM_LOB,
			'longblob'			=> \PDO::PARAM_LOB,
			'tinyblob'			=> \PDO::PARAM_LOB,
		];
	}
901004
public function getGroup()
    {
        $this->group || $this->group = wei()->group()->findOrInitById($this['groupId'], ['name' => '未分组']);

        return $this->group;
    }
735583
public function toArray()
    {
        return [
            'id'          => $this->id,
            'module'      => $this->module,
            'bundle'      => $this->bundle,
            'position'    => $this->position,
            'name'        => $this->name,
            'description' => $this->description,
            'category'    => $this->category,
            'active'      => $this->active,
            'tags'        => $this->tags
        ];
    }
316093
public function getGroups()
	{
		if (!is_array($this->_xml))
		{

			return false;
		}

		$results = array();
		foreach ($this->_xml as $name => $group)
		{
			$results[$name] = $this->getNumParams($name);
		}

		return $results;
	}
386218
public function getDefinitions()
    {

        // 获取扫描的PHP文件
        $classNames     = $this->registerLoaderAndScanBean();
        $fileClassNames = $this->scanFilePhpClass();
        $classNames     = array_merge($classNames, $fileClassNames);

        foreach ($classNames as $className) {
            $this->parseBeanAnnotations($className);
        }
        $this->parseAnnotationsData();

        return $this->definitions;
    }
111630
public function getAsGroupedArray(): array
    {
        $result = array();

        foreach ($this->_groups as $groupName => $memberKeys) {
            $members = array();

            foreach ($memberKeys as $key) {
                $members[$key] = $this->getFieldAsArray($key);
            }

            $result[$groupName] = array(
                'group_name' => $groupName,
                'group_caption' => $this->_('group_' . $groupName),
                'fields' => $members
            );
        }

        return $result;
    }
884834
public function parse() {
        $result = [];
        foreach ($this->routingTable as $key => $route) {
            $this->params = [];
            $route['regx'] = preg_replace_callback(
                "/%([^%]+)%/",
                [$this, 'match'],
                preg_quote(str_replace(['[', ']', ':'], ['%', '%', ' '], $route['url']))//$route['url']
            );

            /** 处理斜线 */
            $route['regx'] = rtrim($route['regx'], '/');
            $route['regx'] = '|^' . $route['regx'] . '[/]?$|';

            $route['format'] = preg_replace("/\[([^\]]+)\]/", "%s", $route['url']);//$route['url']
            $route['params'] = $this->params;

            $result[$key] = $route;
        }

        return $result;
    }
1209390
public function getModuleList()
    {
        $controller = $this->config['controller'];
        $list = [];
        foreach ($controller as $class) {
            if (class_exists($class)) {
                $reflection = new \ReflectionClass($class);
                $doc_str = $reflection->getDocComment();
                $doc = new DocParser();
                $class_doc = $doc->parse($doc_str);
                if(array_key_exists('group', $class_doc)){
                    $key = array_search($class_doc['group'], array_column($list, 'title'));
                    if($key === false){ //创建分组
                        $floder = [
                            'title' => $class_doc['group'],
                            'children' => []
                        ];
                        array_push($floder['children'], $class_doc);
                        array_push($list, $floder);
                    }
                    else
                    {
                        array_push($list[$key]['children'], $class_doc);
                    }
                }else{
                    array_push($list, $class_doc);
                }
            }
        }
        return $list;
    }
967484
public function toArray()
    {
        return array_merge(
            [
                'linha_digitavel' => $this->getLinhaDigitavel(),
                'codigo_barras' => $this->getCodigoBarras(),
                'beneficiario' => [
                    'nome' => $this->getBeneficiario()->getNome(),
                    'endereco' => $this->getBeneficiario()->getEndereco(),
                    'bairro' => $this->getBeneficiario()->getBairro(),
                    'cep' => $this->getBeneficiario()->getCep(),
                    'uf' => $this->getBeneficiario()->getUf(),
                    'cidade' => $this->getBeneficiario()->getCidade(),
                    'documento' => $this->getBeneficiario()->getDocumento(),
                    'nome_documento' => $this->getBeneficiario()->getNomeDocumento(),
                    'endereco2' => $this->getBeneficiario()->getCepCidadeUf(),
                    'endereco_completo' => $this->getBeneficiario()->getEnderecoCompleto(),
                ],
                'logo_base64' => $this->getLogoBase64(),
                'logo' => $this->getLogo(),
                'logo_banco_base64' => $this->getLogoBancoBase64(),
                'logo_banco' => $this->getLogoBanco(),
                'codigo_banco' => $this->getCodigoBanco(),
                'codigo_banco_com_dv' => $this->getCodigoBancoComDv(),
                'especie' => 'R$',
                'data_vencimento' => $this->getDataVencimento(),
                'data_processamento' => $this->getDataProcessamento(),
                'data_documento' => $this->getDataDocumento(),
                'data_desconto' => $this->getDataDesconto(),
                'valor' => Util::nReal($this->getValor(), 2, false),
                'desconto' => Util::nReal($this->getDesconto(), 2, false),
                'multa' => Util::nReal($this->getMulta(), 2, false),
                'juros' => Util::nReal($this->getJuros(), 2, false),
                'juros_apos' => $this->getJurosApos(),
                'dias_protesto' => $this->getDiasProtesto(),
                'sacador_avalista' =>
                    $this->getSacadorAvalista()
                        ? [
                        'nome' => $this->getSacadorAvalista()->getNome(),
                        'endereco' => $this->getSacadorAvalista()->getEndereco(),
                        'bairro' => $this->getSacadorAvalista()->getBairro(),
                        'cep' => $this->getSacadorAvalista()->getCep(),
                        'uf' => $this->getSacadorAvalista()->getUf(),
                        'cidade' => $this->getSacadorAvalista()->getCidade(),
                        'documento' => $this->getSacadorAvalista()->getDocumento(),
                        'nome_documento' => $this->getSacadorAvalista()->getNomeDocumento(),
                        'endereco2' => $this->getSacadorAvalista()->getCepCidadeUf(),
						'endereco_completo' => $this->getSacadorAvalista()->getEnderecoCompleto(),
                    ]
                        : [],
                'pagador' => [
                    'nome' => $this->getPagador()->getNome(),
                    'endereco' => $this->getPagador()->getEndereco(),
                    'bairro' => $this->getPagador()->getBairro(),
                    'cep' => $this->getPagador()->getCep(),
                    'uf' => $this->getPagador()->getUf(),
                    'cidade' => $this->getPagador()->getCidade(),
                    'documento' => $this->getPagador()->getDocumento(),
                    'nome_documento' => $this->getPagador()->getNomeDocumento(),
                    'endereco2' => $this->getPagador()->getCepCidadeUf(),
					'endereco_completo' => $this->getPagador()->getEnderecoCompleto(),
                ],
                'demonstrativo' => $this->getDescricaoDemonstrativo(),
                'instrucoes' => $this->getInstrucoes(),
                'instrucoes_impressao' => $this->getInstrucoesImpressao(),
                'local_pagamento' => $this->getLocalPagamento(),
                'numero' => $this->getNumero(),
                'numero_documento' => $this->getNumeroDocumento(),
                'numero_controle' => $this->getNumeroControle(),
                'agencia_codigo_beneficiario' => $this->getAgenciaCodigoBeneficiario(),
                'nosso_numero' => $this->getNossoNumero(),
                'nosso_numero_boleto' => $this->getNossoNumeroBoleto(),
                'especie_doc' => $this->getEspecieDoc(),
                'especie_doc_cod' => $this->getEspecieDocCodigo(),
                'aceite' => $this->getAceite(),
                'carteira' => $this->getCarteira(),
                'carteira_nome' => $this->getCarteiraNome(),
                'uso_banco' => $this->getUsoBanco(),
                'status' => $this->getStatus(),
                'mostrar_endereco_ficha_compensacao' => $this->getMostrarEnderecoFichaCompensacao()
            ], $this->variaveis_adicionais
        );
    }
327654
protected function getSelectString(): string
    {
        $statement = '';
        $fieldSelect    = $this->builder->getSelect();
        $aggregate = $this->builder->getAggregate();
        if (empty($fieldSelect) && empty($aggregate)) {
            return $statement;
        }

        $select = $this->getAggregateStatement($fieldSelect, $aggregate);

        // 字段组拼
        foreach ($select as $column => $alias) {
            // Filter db keyword
            if (array_key_exists($column, $fieldSelect) && trim($column) != '*' && strpos($column, '.') === false) {
                // 判断是否为函数调用
                if (strpos($column, '(') || strpos($column, ')')) {
                    $column = sprintf('%s', $column);
                } else {
                    $column = sprintf('`%s`', $column);
                }
            }

            $statement .= $column;
            if ($alias !== null) {
                $statement .= sprintf(' AS `%s`', $alias);
            }
            $statement .= ', ';
        }

        //select组拼
        $statement = substr($statement, 0, -2);
        if (!empty($statement)) {
            $statement = 'SELECT ' . $statement;
        }

        return $statement;
    }
262995
public function toArray()
	{
		$list = parent::toArray();

		$list['text.languageid'] =  $this->getLanguageId();
		$list['text.typeid'] = $this->getTypeId();
		$list['text.label'] = $this->getLabel();
		$list['text.type'] = $this->getType();
		$list['text.domain'] = $this->getDomain();
		$list['text.content'] = $this->getContent();
		$list['text.status'] = $this->getStatus();

		return $list;
	}
487400
public function toArray()
    {
        return [
            'hard_quota' => $this->getHardQuota(),
            'soft_quota' => $this->getSoftQuota(),
            'soft_quota_percent' => $this->getSoftQuotaPercent(),
            'usage' => $this->getUsage(),
            'usage_percent' => $this->getUsagePercent(),
            'remaining_soft_quota' => $this->getRemainingSoftQuota(),
            'remaining_soft_quota_percent' => $this->getRemainingSoftQuotaPercent(),
            'remaining_hard_quota' => $this->getRemainingHardQuota(),
            'remaining_hard_quota_percent' => $this->getRemainingHardQuotaPercent(),
        ];
    }
1013530
protected function sectionLocalization()
	{
		$f = Yii::$app->formatter;

		return [
			'Locale'=>$f->locale,
			'Language'=>Yii::$app->language,
			'Source lang'=>Yii::$app->sourceLanguage,
			'Timezone'=>Yii::$app->timeZone,
			'Local time ' . Yii::$app->timeZone=>function() {
				$dtCur = new \DateTime('now', new \DateTimeZone(Yii::$app->timeZone));
				return $dtCur->format('d.m.Y H:i:s') . ' ' . Html::tag('span', 'UTC-offset: ' . $dtCur->getOffset() . 's', ['class'=>'text-muted']);
			},
			'Local time UTC'=>function() {
				$dtUtc = new \DateTime('now', new \DateTimeZone('UTC'));
				return $dtUtc->format('d.m.Y H:i:s');
			},
			'Date format'=>$this->valueCode($f->dateFormat),
			'Time format'=>$this->valueCode($f->timeFormat),
			'DateTime format'=>$this->valueCode($f->datetimeFormat),
			'Boolean format'=>$this->valueVarDump($f->booleanFormat),
		];
	}
977951
protected function getGroupContentColumns(): array
    {
        $contents = $this->getGroupContents();

        $contentCount = count($contents);

        $denominator = floor(static::GRID_SIZE_WITHOUT_LABEL / $contentCount);

        $labelWidth = $denominator > 1 ? 2 : 1;

        // If there is enough space, make labels size 2
        // and spread the rest as evenly as possible over the fields
        // If there is not enough space, try again with labels at size 1
        $labelsTotalWidth = $labelWidth * array_reduce(
            $contents,
            function ($total, $content) {
                return $total + ($content['type'] !== 'field' ? 1 : 0);
            }
        );

        $fieldsCount = array_reduce(
            $contents,
            function ($total, $content) {
                return $total + ($content['type'] === 'field' ? 1 : 0);
            }
        );

        $fieldWidth = (int) floor((static::GRID_SIZE_WITHOUT_LABEL - $labelsTotalWidth) / $fieldsCount);

        $columns = [];

        foreach ($contents as $content) {

            $columns[] = ($content['type'] === 'field') ? $fieldWidth : $labelWidth;
        }

        return $columns;
    }
1186174
public function getRawData()
    {
        return [
            'ord' => $this->ord,
            'viewname' => $this->viewname,
            'label_en' => $this->labels['en'],
            'label_fr' => $this->labels['fr'],
            'label_de' => $this->labels['de'],
            'label_nl' => $this->labels['nl'],
        ];
    }
951101
public function toArray()
    {
        return [
            'prefix' => $this->prefix,
            'entity' => $this->entity,
            'lower_entities' => $this->getLowerEntities(),
            'lower_singular_entity' => $this->getLowerSingularEntity(),
            'studly_entity' => $this->getStudlyEntity(),
            'studly_plural_entity' => $this->getStudlyPluralEntity(),
            'prefix_dot' => $this->getPrefixDot(),
            'prefix_slash' => $this->getPrefixSlash(),
        ];
    }