PHPackages                             php-etl/prestashop-expression-language - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-etl/prestashop-expression-language

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-etl/prestashop-expression-language
======================================

This library implements functions for manipulating Prestashop data in ExpressionLanguage

v0.1.x-dev(2y ago)037MITPHPPHP &gt;=8.2

Since Sep 1Pushed 1mo agoCompare

[ Source](https://github.com/php-etl/prestashop-expression-language)[ Packagist](https://packagist.org/packages/php-etl/prestashop-expression-language)[ RSS](/packages/php-etl-prestashop-expression-language/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Prestashop Expression Language
==============================

[](#prestashop-expression-language)

This package extends the [ExpressionLanguage](https://symfony.com/doc/current/components/expression_language.html) Symfony component to manipulate data coming from Akeneo into valid Prestashop data.

[![Quality (PHPStan lvl 4)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/quality.yaml)[![PHPUnit](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpunit.yaml)[![Infection](https://github.com/php-etl/prestashop-expression-language/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/infection.yaml)[![PHPStan level 5](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-5.yaml)[![PHPStan level 6](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-6.yaml)[![PHPStan level 7](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-7.yaml)[![PHPStan level 8](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/prestashop-expression-language/actions/workflows/phpstan-8.yaml)[![PHP](https://camo.githubusercontent.com/b0dc73aa55cbed43533eaf24470aa9297fb9629e0c59f7dc19ee597564d0e148/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068702d65746c2f70726573746173686f702d65787072657373696f6e2d6c616e6775616765)](https://camo.githubusercontent.com/b0dc73aa55cbed43533eaf24470aa9297fb9629e0c59f7dc19ee597564d0e148/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068702d65746c2f70726573746173686f702d65787072657373696f6e2d6c616e6775616765)

Documentation
-------------

[](#documentation)

[See full Documentation](https://php-etl.github.io/documentation)

Installation
------------

[](#installation)

```
composer require php-etl/prestashop-expression-language

```

Usage
-----

[](#usage)

You can use these expressions in your configuration files as in the following example :

```
foo: '@=booleans(my_akeneo_attribute_code: {the_akeneo_value_to search for: the_prestashop_id_replacement})'
```

Attribute functions
-------------------

[](#attribute-functions)

Functions that turn an Akeneo attribute into a Prestashop attribute\_option\_value.

### booleans

[](#booleans)

```
# input
{values: {new_collection: [{scope: null, data: true}]}}

#function
field: '[associations][product_option_values][product_option_value]'
expression: 'booleans({ new_collection: {true: 52, false: 53} })'

#output

            52

```

### lists

[](#lists)

```
# input
{values: {categories: ["spring", "summer"]}}

#function
field: '[associations][product_option_values][product_option_value]'
expression: 'lists({ categories: {spring: 74, autumn: 75, summer: 76} })'

#output

            74

            76

```

### measurements

[](#measurements)

```
# input
{values: {weigth_net: {scope: null, data: {amount: "341.000"}}}}

#function
field: '[associations][product_option_values][product_option_value]'
expression: 'measurements({ weigth_net: {"340.000": 21, "341.000": 22, "342.000": 23} })'

#output

            22

```

### scalars

[](#scalars)

```
# input
{values: {color: {scope: null, data: "navy_blue"}}}

#function
field: '[associations][product_option_values][product_option_value]'
expression: 'scalars({ navy_blue: {salmon: 39, citrus: 40, navy_blue: 41, anthracite: 42} })'

#output

            41

```

Features function
-----------------

[](#features-function)

Function that turns an Akeneo attribute into a Prestashop feature.

### booleanAttributeToFeature

[](#booleanattributetofeature)

```
# input
{values: {color: true, varnish: false}}

# function
- field: '[associations][product_features]'
    expression: >
      booleanAttributeToFeature([
        {
          akeneo_code: 'color',
          prestashop_id: 16,
          values: {
            true: 120,
            false: 121,
          }
        },
        {
          akeneo_code: 'varnish',
          prestashop_id: 20,
          values: {
            true: 63,
            false: 64
          }
        }
      ])

# output

      16
      120

      20
      64

```

### mapFeatures

[](#mapfeatures)

```
# input
{id_feature_value: '23,24,25', id: 17}

# function
- field: '[associations][product_features]'
  expression: 'mapFeatures(lookup)'

# output

      23
      17

      24
      17

      25
      17

```

### features

[](#features)

```
# input
{values: {norm: {scope: null, data: "ean188"}}}

#function
field: '[associations][product_features]'
expression: >
    features([
        {
            akeneo_code: 'norm',
            prestashop_id: 15,
            values: {
                ean144: 97,
                ean1502_b: 98,
                ean188: 99,
            }
        }
    ])

#output

            15
            99

```

### mapIds

[](#mapids)

```
# input
{1,2,3}

# function
- field: '[categories]'
  expression: 'mapIds(input)'

# output

  1
  2
  3

```

### splitAndTrim

[](#splitandtrim)

```
# input
{' Foo, bAr ,BAZ'}

# function
- field: '[words]'
  expression: 'splitAndTrim(",", input)'

# output

  foo
  bar
  baz

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance62

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

981d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/144109625f8029112d56f43d08120cf03a0918ea3b4fd59ab53f09b02f630b00?d=identicon)[gplanchat](/maintainers/gplanchat)

---

Top Contributors

[![clemzarch](https://avatars.githubusercontent.com/u/28787740?v=4)](https://github.com/clemzarch "clemzarch (5 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/php-etl-prestashop-expression-language/health.svg)

```
[![Health](https://phpackages.com/badges/php-etl-prestashop-expression-language/health.svg)](https://phpackages.com/packages/php-etl-prestashop-expression-language)
```

###  Alternatives

[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[ginq/ginq

LINQ to Object inspired DSL for PHP

192257.5k3](/packages/ginq-ginq)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
