| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This package adds a command to your symfony project. You'll be able to export excel files representing your entities in order to help you to fill database with client data.
This program doesn't export any data. It just export structure of your data inb order to help you and/or your clients to give you data well formatted before import them.
Symfony > 4.4
php > 7.0
This software is free to use, modify and share. It's made with a lot of love but comes without any guarantee.
first run composer require frvaillant/entitytoexcel
Edit your config/services.yaml file and add under services key :
services:
EntityToExcel\Command\EntityToCsvCommand:
tags:
- { name: 'console.command', command: 'entity:excel' }launch command in your terminal :
php bin/console entity:excel Entity
Replace Entity by the name of the entity you want to export as excel file
The file is exported as Entity.xlsx in the public/xls directory
Each property of your entity is reported on each column of the table.
On the first line, the name of the property
On the second line, the display name (if you choose some (see below))
On the third line, the default values
The package comes with an annotation class wich allows you to be more precise
Use it with @EtEx()
/**
* @EtEx(exclude=true)
* @ORM\Column(type="string", length=255)
*/
private $name; /**
* @EtEx(list={"1", "0"}, defaultValue="0")
* @ORM\Column(type="boolean")
*/
private $isMusician; /**
* @EtEx(listFromEntityWith="name")
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="companies")
* @ORM\JoinColumn(nullable=true)
*/
private $category; /**
* @EtEx(defaultValue="My value")
* @ORM\Column(type="string")
*/
private $label; /**
* @EtEx(displayName="Service maître")
* @ORM\Column(type="array", nullable=true)
*/
private $headService; /**
* @EtEx(includeFields=true, displayName="Precision if this person is musician")
* @ORM\OneToOne(targetEntity=Musician::class, cascade={"persist", "remove"})
*/
private $musicianPrecision;You can use one of the above parameters, and of course you can use as much filters as you like
/**
* @EtEx(list={"0", "1", "2"}, displayName="your word", defaultValue="1")
*/The reverse side of this program is on the way in order to import data following excel files.
To be continued ...
Feel free to report any encountered problem using issues on github
Github repository : https://github.com/frvaillant/EntityToExcel/
| Back | FazBrowse Home | New Git URL |