Download the PHP package draw/sonata-import-bundle without Composer

On this page you can find all versions of the php package draw/sonata-import-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sonata-import-bundle

DrawSonataImportBundle

This bundle add a basic import from csv system of entities in Sonata.

It's currently only support update of existing entities.

Base on a configuration you can set which entity can be imported.

When uploading a csv file the system will detect the list of attribute base on a header column. It will then try to detect the identifier and the mutator to update the entities.

Configuration

Here is an example of the configuration:

This tell the system that it support import for App\Entity\User and App\Entity\Product.

Sonata admin

A new menu Import will be available on the lef menu to create a new import. A dropdown to specify which entity you are importing is available base on the configuration. There is also an action Import on the list view of the entities that will link directly to this page with the entity selected in the dropdown.

You must select a csv file from which the system will detect the header and will try to fill the column information. You can then adjust it manually and select to Process the file.

Column Information Extraction

The system try to extract column information base on a Draw\Bundle\SonataImportBundle\Column\ColumnBuilder\ColumnBuilderInterface. There is two extractor provider with the system, one that will set if a column is the identifier base on it's name (id only), another one that will check if there is a setter base on the header to assign the mutator.

Import

When importing data a event Draw\Bundle\SonataImportBundle\Event\AttributeImportEvent is dispatch for every entity/column. Listening to this event let you do custom import logic of the data. If you did process the event you need to stop is propagation. If the event was not stop, the import logic will fall back on the column mutator that was set.

The setter just do a simple set of the raw value in the column (that is always a string) so if it's a reference to another object you must implement a listener to do have a custom logic.


All versions of sonata-import-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
draw/sonata-extra-bundle Version ^0.17
sonata-project/admin-bundle Version ^4.8
sonata-project/doctrine-orm-admin-bundle Version ^4.2
symfony/event-dispatcher Version ^6.4.0
symfony/notifier Version ^6.4.0
symfony/validator Version ^6.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package draw/sonata-import-bundle contains the following files

Loading the files please wait ....