PHP code example of frvaillant / entitytoexcel

1. Go to this page and download the library: Download frvaillant/entitytoexcel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

frvaillant / entitytoexcel example snippets


    /**
     * @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((targetEntity=Musician::class, cascade={"persist", "remove"})
     */
    private $musicianPrecision;

    /**
     * @EtEx(list={"0", "1", "2"}, displayName="your word", defaultValue="1")
     */