rch/importer

Light Importer library


Keywords
orm, json, xml, data, propel, xls, csv, import, doctrine, convert
License
GPL-3.0

Documentation

Importer

Build Status SensioLabsInsight

Importer is a lightweight library to import data to database using a large set of formats, orm and database engines. .

Installation

In command-line, download the latest version:

$ composer require rch/importer

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Usage

<?php

// Choose a source Reader
$reader = new CsvReader('users.csv');

// Prepare the data Recorder
$recorder = new DoctrineORMEntityRecorder($em, 'Acme\Entity\User');

// Specify which property use for headers
$recorder->setKeymap(array('customColumnName' => 'realProperty'));

// Import the data
Importer::create($reader, $recorder)->import();

License

The code is released under the business-friendly GPL-3.0 license.

License