[TYPO3-english] FAL: Right way of doing?

Mikel lists at con-version.com
Fri Mar 22 17:45:29 CET 2013


Hi Benni,

thanks for your reply :-)

I guess I understood your "logic". But to be honest: I don't know which 
Repository to take. But it must be something like that, right?
$collection = new \TYPO3.....\Resource\Repository;
$collection->findByUid(2)->loadContents();

The file collection is a "Static selection of files".

Mikel

Am 22.03.13 17:00, schrieb Benjamin Mack:
> Hey Mikel :)
>
> nice hearing from you. We are currently at the FAL code sprint in
> Bochum, fixing a lot of current issues.
>
>   * sys_file_collection => a group of files, "bundled" together
>   * sys_file_reference => connecting a file to a content element or a
> page, with additional meta data.
>
> The best way (in my eyes ;-)) is to actually to
>
> 1. create the ResourceCollectionRepository
> 2. fetch the collection with "findByUid()"
> 3. call "loadContents()" on the collection, then you can use it like any
> other collection for looping etc.
>
> Does that work for you?
>
> All the best,
> Benni.
>
> On 22.03.13 16:28, Mikel wrote:
>> Hi all,
>>
>> after playing around with the new file abstraction layer for a few
>> hours, I'm looking for the best way to handle relations.
>>
>> I made a new record for a file collection and added a few images. Also I
>> translated that new record to another language. Now I have two entries
>> in "sys_file_collection". All the references appear in
>> "sys_file_reference".
>>
>> But what is the best way to get all files related to the given uid of a
>> collection? I guess I have to use the FileRepository and filter the
>> query to get only records with the uid of the collection?
>>
>> Or should I get the File Collection by Uid and get all relevant objects
>> from here?
>>
>> I guess a few lines of code should do it, but finding the right lines is
>> hard :-)
>>
>> Mikel
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list