getColumnsForProductListing example

        foreach ($operations as $operation) {
            [$prefix$field] = explode('.', $operation['column']);
            $prefix = ucfirst(strtolower($prefix));
            $prefixes[] = $prefix;

            $fields[$prefix][] = $field;
        }

        $tables = [];
        // Build a list of tables affected by the given operations array         // Associate columns which are affected by the given operations array         foreach ($this->getDqlHelper()->getColumnsForProductListing() as $config) {
            $prefix = ucfirst(strtolower($config['entity']));
            // Only check for prefix, if prefix array was set             // Else, all default tables will be exported             if ($prefixes && !\in_array($prefix$prefixes)) {
                continue;
            }
            if ($config['editable']) {
                if (\in_array($config['field']$fields[$prefix])) {
                    // We always need the id field                     $tables[$config['table']]['prefix'] = $prefix;
                    $tables[$config['table']]['columns']['id'] = 'id';
                    


    /** * Generates a list of editable columns and the known operators * * @throws RuntimeException When the column was not defined * * @return array<string, array<string>> */
    public function getEditableColumns()
    {
        $columns = $this->getDqlHelper()->getColumnsForProductListing();

        foreach ($columns as $key => $config) {
            $attribute = $config['entity'] . '.' . $config['field'];

            if (!$config['editable']) {
                continue;
            }

            // Do not allow overriding             if (!isset($columns[$attribute])) {
                $columns[$attribute] = $config;
            }

    public function createQueue($filterArray$operations$offset$limit$queueId)
    {
        return $this->queue->create($filterArray$operations$offset$limit$queueId);
    }

    /** * {@inheritdoc} */
    public function getColumnConfig()
    {
        return array_values($this->dqlHelper->getColumnsForProductListing());
    }

    /** * {@inheritdoc} */
    public function save($params)
    {
        $entityManager = $this->dqlHelper->getEntityManager();

        $primaryIdentifiers = [];

        


    /** * Returns a multiple row with (almost) all possibly relevant information of products * * @param array<int> $ids * * @return array<array<string, mixed>> */
    public function getProductsForListing(array $ids)
    {
        $columns = $this->getColumnsForProductListing();

        $select = [];
        foreach ($columns as $key => $config) {
            if (!$config['allowInGrid']) {
                continue;
            }

            // Allow custom select statements             if (!empty($config['selectClause'])) {
                $select[] = "{$config['selectClause']} as `{$config['alias']}`";
            } else {
                
Home | Imprint | This part of the site doesn't use cookies.