getColumnType example



        if ($this->attributeConfigList === null) {
            $this->attributeConfigList = $this->crudService->getList('s_articles_attributes');
        }

        foreach ($this->attributeConfigList as $attributeConfig) {
            $columnName = $attributeConfig->getColumnName();
            if ($attributes['core']->exists($columnName)) {
                $value = $attributes['core']->get($columnName);

                if ($attributeConfig->getColumnType() === 'boolean') {
                    $value = $value === '1';
                }

                $attributes['core']->set($columnName$value);
            }
        }

        return $attributes;
    }

    private function neededToIndex(array $groups, VariantFacet $variantFacet): bool
    {
if ($default === 'NULL') {
                $default = null;
            }

            $item = new ConfigurationStruct();
            $item->setTableName($table);
            $item->setColumnName($column->getName());
            $item->setIdentifier($this->tableMapping->isIdentifierColumn($table$column->getName()));
            $item->setCore($this->tableMapping->isCoreColumn($table$column->getName()));
            $item->setColumnType($this->typeMapping->dbalToUnified($column->getType()));
            $item->setElasticSearchType($this->typeMapping->unifiedToElasticSearch($item->getColumnType()));
            $item->setDefaultValue($default);

            if (isset($configuration[$name])) {
                $config = $configuration[$name];
                $item->setId((int) $config['id']);
                $item->setColumnType($config['columnType']);
                $item->setSupportText($config['supportText']);
                $item->setHelpText($config['helpText']);
                $item->setDisplayInBackend((bool) $config['displayInBackend']);
                $item->setReadonly((bool) $config['readonly']);
                $item->setLabel($config['label']);
                
$aggregations = $elasticResult['aggregations'];

        foreach ($this->criteriaParts as $criteriaPart) {
            $key = $criteriaPart->getName();

            if (!isset($aggregations[$key])) {
                continue;
            }

            $attribute = $this->crudService->get('s_articles_attributes', $criteriaPart->getField());

            $type = $attribute ? $attribute->getColumnType() : '';

            if (\is_array($aggregations[$key]['buckets'])) {
                $aggregations[$key]['buckets'] = array_filter($aggregations[$key]['buckets']function D$item) {
                    return $item['key'] !== '';
                });
            }

            if (\in_array($type[TypeMappingInterface::TYPE_DATE, TypeMappingInterface::TYPE_DATETIME], true)) {
                $aggregations[$key] = $this->formatDates($aggregations[$key]);
            }

            
for ($i = $offset$i <= $offset + $limit; ++$i) {
            if (!isset($data[$i])) {
                break;
            }
            $struct = $data[$i];
            if (!$struct->displayInBackend()) {
                continue;
            }
            $columns[] = [
                'column' => $struct->getColumnName(),
                'label' => $struct->getLabel() ?: $struct->getColumnName(),
                'type' => $struct->getColumnType(),
            ];
        }

        $this->View()->assign([
            'success' => true,
            'data' => $columns,
            'total' => \count($data),
        ]);
    }

    /** * @return void */
 ?FacetResultInterface {
        $query = $this->queryBuilderFactory->createQuery($reverted$context);
        $query->resetQueryPart('orderBy');
        $query->resetQueryPart('groupBy');

        $sqlField = 'productAttribute.' . $facet->getField();
        $query->andWhere($sqlField . ' IS NOT NULL')
            ->andWhere($sqlField . " NOT IN ('', '0', '0000-00-00')");

        $attribute = $this->crudService->get('s_articles_attributes', $facet->getField());

        $type = $attribute ? $attribute->getColumnType() : null;

        switch ($facet->getMode()) {
            case ProductAttributeFacet::MODE_VALUE_LIST_RESULT:
            case ProductAttributeFacet::MODE_RADIO_LIST_RESULT:
                $result = $this->createValueListFacetResult($query$facet$criteria$context);
                break;

            case ProductAttributeFacet::MODE_BOOLEAN_RESULT:
                $result = $this->createBooleanFacetResult($query$facet$criteria);
                break;

            
Home | Imprint | This part of the site doesn't use cookies.