public function load(ObjectManager $manager)
    {
        /*
         * creates a Media of type mm_media.type.image
         */
        $media = new Media();
        $media->setAuthor('Max Mustermann');
        $media->setCopyright('Mustermann gGmbH');
        $media->setDescription('This is a Media description.');
        $media->setName('Media-Name');

        $media->setMediaTypeMetadata(array('foo' => 'bar'));
        $media->setMediaType(new ImageMediaType());
        $media->setMediaTypeReference('image.jpg');

        /*
         * creates a MediaSortable
         */
        $mediaSortable1 = new MediaSortable();
        $mediaSortable1->setPosition(1);
        $mediaSortable1->setMedia($media);

        $this->addReference('mediaSortable-1', $mediaSortable1);

        $manager->persist($mediaSortable1);

        $manager->flush();
    }
public function load(ObjectManager $manager)
    {
        /*
         * creates a Media of type mm_media.type.image
         */
        $media = new Media();
        $media->setAuthor('Max Mustermann');
        $media->setCopyright('Mustermann gGmbH');
        $media->setDescription('This is a Media description.');
        $media->setName('Media-Name');

        $media->setMediaTypeMetadata(array('foo' => 'bar'));
        $media->setMediaType(new ImageMediaType());
        $media->setMediaTypeReference('image.jpg');

        /*
         * creates a MediaSortable
         */
        $mediaSortable1 = new MediaSortable();
        $mediaSortable1->setPosition(1);
        $mediaSortable1->setMedia($media);

        $this->addReference('mediaSortable-1', $mediaSortable1);

        $manager->persist($mediaSortable1);

        $manager->flush();
    }
{@inheritdoc}