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

Benjamin Mack benni at typo3.org
Fri Mar 22 17:00:58 CET 2013


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



More information about the TYPO3-english mailing list