PHP code example of tweedegolf / media-bundle

1. Go to this page and download the library: Download tweedegolf/media-bundle 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/ */

    

tweedegolf / media-bundle example snippets




namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use TweedeGolf\MediaBundle\Model\AbstractFile;

/**
 * @ORM\Entity
 * @ORM\Table
 * @ORM\Entity(repositoryClass="TweedeGolf\MediaBundle\Entity\FileRepository")
 */
class File extends AbstractFile
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    public function getId(): int
    {
        return $this->id;
    }
}


return [
    // ...
    Vich\UploaderBundle\VichUploaderBundle::class => 'all',
    Liip\ImagineBundle\LiipImagineBundle::class => 'all',
    TweedeGolf\MediaBundle\TweedeGolfMediaBundle::class => 'all',
    // ...
];

public function registerBundles()
{
    return [
        // ...
        new Vich\UploaderBundle\VichUploaderBundle(),
        new Liip\ImagineBundle\LiipImagineBundle(),
        new TweedeGolf\MediaBundle\TweedeGolfMediaBundle(),
        // ...
    ];
}