Entity Manager in Drupal 8

$storage = \Drupal::entityManager()->getStorage('node');
$nids = $storage->getQuery()
->condition('type', 'media')
->condition('status', 1)
->execute();
$nodeArray = $storage->loadMultiple($nids);

Converting Object to Array:
$object->toArray()