[TYPO3-mvc] extbase queries, add count() and left join
Philipp Wrann
philippwrann at gmail.com
Wed Jun 25 11:49:20 CEST 2014
The join is generated by extbase when adding constraints on other models... you need to connect your models and set up the tca correctly.
To get the count you call the count method of your query object.
add a property-filter:
$query->matching($query->contains('categories',$category));
counting:
$query->count();
Just return the queryresult from the repository, you can handle it in your view.
(return $query->execute())
in your view:
{objects -> f:count()}
or iterate through your results
<f:widget.paginate objects="{objects}" as="paginated">
<ul>
<f:for each="{paginated}" as="object">
<li>{object.category.title}</li>
</f:for>
</ul>
</f:widget.paginate>
More information about the TYPO3-project-typo3v4mvc
mailing list