code: public function transform($iterator)
      {
          if (null === $iterator) {
              return array();
          }
  
          if (is_array($iterator)) {
              return $iterator;
          }
  
          if (!$iterator instanceof Iterator) {
              throw new TransformationFailedException('Expected a Yucca\Component\Iterator\Iterator object.');
          }
  
          return $iterator->getArray();
      }
docs: Transforms a yucca iterator into an array.
  
  @param Iterator $iterator A collection of entities
  
  @return mixed An array of entities
  
  @throws TransformationFailedException