```php
if (!$records->isEmpty()) {
    ...
``` 

From doctrine doc "This is preferable over count() == 0."