Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Custom Entity Bundle Laravel Package

adeoweb/custom-entity-bundle

Symfony bundle for Akeneo PIM that streamlines creating and managing reference data (custom entities) and related UI views. Install via Composer, register routes and bundle, and optionally add a quick export job for CSV reference data.

View on GitHub
Deep Wiki
Context7

Akeneo Custom Entity Bundle

The custom entity bundle provides the following tools to help managing custom entities inside the Akeneo PIM.

User Interface

Navigation

To add your custom entity in the Reference data menu, you must add it to the menu.yml form extension.

You will find an example of these form extensions in the example Custom Bundle.

CRUD form

The custom entity CRUD form are defined as form extension. You will find corresponding examples in the Custom Bundle.

  • index.yml: defines the custom entity grid. The grid must also be configured as all other PIM grids. Here is the example for the Color entity.

  • create.yml: defines the creation form. In this form you will declare all the entity fields.

  • edit.yml: defines the edition form.

The delete modal window does not need to be defined because it's part of the core PIM.

Custom components

Custom Entity dropdown list for single and multi select

You can use a form component to link one custom entity to another one. One example is available in the provided AcmeCustomBundle.

Custom entity that supports single select:

acme_custom-edit-form-properties-association:
    module: custom_entity/field/custom-entity-select
    parent: acme_custom-edit-form-properties-common
    targetZone: content
    position: 270
    config:
        fieldName: fabric
        choiceNameField: code
        choiceValueField: name
        isCustomEntity: true
        entityName: fabric
        required: false

Custom entity that supports multi select:

acme_custom-edit-form-properties-association:
    module: custom_entity/field/custom-entity-select
    parent: acme_custom-edit-form-properties-common
    targetZone: content
    position: 270
    config:
        fieldName: fabric
        choiceNameField: code
        choiceValueField: name
        isCustomEntity: true
        entityName: fabric
        required: false
        isMultiple: true

Field on a custom entity that refers to a built in akeneo type (special usecase for us)

pim-entity-edit-form-properties-attribute:
    module: custom_entity/field/custom-entity-select
    parent: pim-entity-edit-form-properties-common
    targetZone: content
    position: 270
    config:
        fieldName: attribute
        choiceNameField: code
        choiceValueField: name
        isCustomEntity: false
        entityName: attribute
        required: false

Internals

Normalizers

All your custom entities must implement a standard normalizer defining the standard format returned by the REST API calls.

Most of the time, it will be a simple flat array of the entity properties.

Again, you will find examples in the Custom Bundle.

This custom normalizer is used in the internal CustomEntity normalizer.

Validation

Entity validation is configured with a YAML file in the standard Symfony way.

Example: Color validation.

AcmeCustomBundle

This extension comes with an extended example bundle that you can use to see Custom Entities in action.

Installation

Register the bundle in AppKernel:

    $bundles = [
        // ...
        new \Pim\Bundle\CustomEntityBundle\PimCustomEntityBundle(),
        new \Acme\Bundle\CustomBundle\AcmeCustomBundle(),
    ]

Update your Doctrine schema:

    php ./bin/console doctrine:schema:update --dump-sql
    php ./bin/console doctrine:schema:update --force

Do not forget to clear your cache and regenerate assets before using the application.

rm -rf ./var/cache ./web/js ./web/css;
bin/console --env=prod pim:installer:assets --symlink --clean; 
yarn run webpack-dev; 
yarn run webpack-test
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui