[TYPO3-mvc] Sorting children (object storage) again

Jan Kornblum jan.kornblum at gmx.de
Thu Aug 1 10:01:39 CEST 2013


Hi again,

maybe i didn't point out cleary what i want: I want to create a 
complete iterating list (over all records, ordered by title) in fluid 
which looks like this:

Companies (sorted by title)
--- Employees (sorted by title)
------ Notes (sorted by title)

What would certainly work as with asking each repository separately it 
would be possible to use the $defaultOrderings variable - but 
definitely not performant:

$allCompanies = $companyRepository->findAll()
$allEmployees = $employeeRepository->findAll()
$allNotes = $noteRepository->findAll()

<f:for each="{allCompanies}" as="company">
	{company.title}
	<f:for each="{allEmployees}" as="employee">
		<f:if condition="{employee.company}={company}">
			{employee.title}
			<f:for each="{allNotes}" as="note">
				<f:if condition="{note.employee}={employee}">
					{note.title}
				</f:if>
			</f:for>
		</f:if>
	</f:for>
</f:for>

How would you achieve this, when the objects are related Company <1:n> 
Employee <1:n1> Note and you want to get a complete list in fluid, 
ordered by own criterias?

Thanks and kind regards, Jan




More information about the TYPO3-project-typo3v4mvc mailing list