src/ORM/UnsavedRelationList.php
public function toArray()
    {
        $items = array();
        foreach ($this->items as $key => $item) {
            if (is_numeric($item)) {
                $item = DataObject::get_by_id($this->dataClass, $item);
            }
            if (!empty($this->extraFields[$key])) {
                $item->update($this->extraFields[$key]);
            }
            $items[] = $item;
        }
        return $items;
    }
public function toArray()
    {
        $items = array();
        foreach ($this->items as $key => $item) {
            if (is_numeric($item)) {
                $item = DataObject::get_by_id($this->dataClass, $item);
            }
            if (!empty($this->extraFields[$key])) {
                $item->update($this->extraFields[$key]);
            }
            $items[] = $item;
        }
        return $items;
    }
public function toArray ( ) { $ items = array ( ) ; foreach ( $ this -> items as $ key => $ item ) { if ( is_numeric ( $ item ) ) { $ item = DataObject :: get_by_id ( $ this -> dataClass , $ item ) ; } if ( ! empty ( $ this -> extraFields [ $ key ] ) ) { $ item -> update ( $ this -> extraFields [ $ key ] ) ; } $ items [ ] = $ item ; } return $ items ; }
Return an array of the actual items that this relation contains at this stage.
This is when the query is actually executed.

@return array
Return an array of the actual items that this relation contains at this stage . This is when the query is actually executed .