Closed sjparkinson closed 9 years ago
Would this also enable using {{ if collection }} in twig and returning false when its empty?
Would this also enable using {{ if collection }} in twig and returning false when its empty?
I'm not sure it would, worth an experiment.
This change ensures the
_elements
property of ArrayCollection is set to an empty array by default.Then calls to methods like
contains
don't explode when you're working with an empty collection property.All credit to @wpillar for the fix.