use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
use Shopware\Core\Framework\Log\Package;
/**
* @extends EntityCollection<CmsSectionEntity>
*/
#[Package('buyers-experience')]
class CmsSectionCollection extends EntityCollection
{ public function getBlocks(): CmsBlockCollection
{ $blocks =
new CmsBlockCollection();
/** @var CmsSectionEntity $section */
foreach ($this->elements
as $section) { if (!
$section->
getBlocks()) { continue;
} $blocks->
merge($section->
getBlocks());
} return $blocks;
}