original_string: public function toArray($returnFields = array())
      {
          if (!$this->isColl) {
              $data = array_fill_keys($returnFields ?: $this->getFields(), null);
              if (!$returnFields) {
                  return $this->data + $data;
              } else {
                  $data = array_fill_keys($returnFields, null);
                  return array_intersect_key($this->data, $data) + $data;
              }
          } else {
              $data = array();
              /** @var $record Record */
              foreach ($this->data as $key => $record) {
                  $data[$key] = $record->toArray($returnFields);
              }
              return $data;
          }
      }
code: public function toArray($returnFields = array())
      {
          if (!$this->isColl) {
              $data = array_fill_keys($returnFields ?: $this->getFields(), null);
              if (!$returnFields) {
                  return $this->data + $data;
              } else {
                  $data = array_fill_keys($returnFields, null);
                  return array_intersect_key($this->data, $data) + $data;
              }
          } else {
              $data = array();
              /** @var $record Record */
              foreach ($this->data as $key => $record) {
                  $data[$key] = $record->toArray($returnFields);
              }
              return $data;
          }
      }
code_tokens: public function toArray ( $ returnFields = array ( ) ) { if ( ! $ this -> isColl ) { $ data = array_fill_keys ( $ returnFields ? : $ this -> getFields ( ) , null ) ; if ( ! $ returnFields ) { return $ this -> data + $ data ; } else { $ data = array_fill_keys ( $ returnFields , null ) ; return array_intersect_key ( $ this -> data , $ data ) + $ data ; } } else { $ data = array ( ) ; /** @var $record Record */ foreach ( $ this -> data as $ key => $ record ) { $ data [ $ key ] = $ record -> toArray ( $ returnFields ) ; } return $ data ; } }
docstring: Returns the record data as array
  
  @param array $returnFields A indexed array specified the fields to return
  @return array
docstring_tokens: Returns the record data as array