I had if($field->hasChildren()) but it's deprecated so i had to use count() or which one do you mean?