Is there any way to show total count of collection on list view? Imagine that there is a user that can have many links. How can I show total links count on list view?
Yes you can show the total count of links for each user, i assume you have arraycollection of links defined in your user entity, define a property named as $totalLinks
and in getter of that property return count of links something like below
class User{
public $totalLinks;
public function getTotalLinks(){
return count($this->getLinks());
}
}
and then in your configureListFields()
you can add $totalLinks
property
protected function configureListFields(ListMapper $list)
{
$list
->add('...')
->add('...')
->add('totalLinks');
}