fix Fatal error: Cannot use Object as array,  is an Object not an array

I have had the experience that the $row variable is the Document Object and not an array, if I try to run this command I get an error similar to this:

Fatal error: Cannot use object of type Application\Networking\InitCmsBundle\Document\User as array