Just in case anyone bump into this 
thread: https://gist.github.com/thoroc/2bd703c7a37707614fff706ff59b668f

On Thursday, February 18, 2016 at 12:28:55 PM UTC, thoroc wrote:
>
> But somehow it doesn't. 
>
> I have given the provider: 'sonata.media.provider.image' to the newly 
> created object, set the context to 'default' and given a full path to the 
> target jpeg file as the binaryContent, but the latter stays desperately 
> null.
>
> On Thursday, December 10, 2015 at 12:34:50 PM UTC, Thomas Rabaix wrote:
>>
>> just use a full path in the binaryContent field. The ImageProvider will 
>> load the binary for you. 
>> https://github.com/sonata-project/SonataMediaBundle/blob/master/Provider/FileProvider.php#L195-L201
>>
>> On Thu, Dec 10, 2015 at 1:14 PM, thoroc <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I am in the process of writing DataFixtures for a project using the 
>>> Sonata/MediaBundle. I have experience creating DataFixtures using the 
>>> Doctrine/DataFixtures, but I am still very new to the MediaBundle.
>>>
>>> Does anyone has an example of pre-populating a DB project images that I 
>>> could follow, and using either Doctrine/DataFixtures, fzaninotto/Faker or 
>>> Nelmio/Alice?
>>>
>>> Thanks,
>>> ~thoroc
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "sonata-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/sonata-users.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Thomas Rabaix 
>> tel: +33 6 51 81 02 41 
>> http://thomas.rabaix.net <http://rabaix.net> 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sonata-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sonata-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to