code: public function toArray()
      {
          $collection = $this->getIterator();
          $plainArray = [];
  
          foreach($collection as $prop => $result) {
              if (is_object($result) && method_exists($result, 'toArray')) {
                  $plainArray[] = $result->toArray();
              } else {
                  $plainArray[] = $result;
              }
          }
          return $plainArray;
      }
docs: Attempts to return the collection as a simple array.
  
  @return array