public function getComponents($componentName, $id = null)
    {
        $components = parent::getComponents($componentName, $id);
        if ($componentName === 'Items' && get_class($components) !== UnsavedRelationList::class) {
            $query = $components->dataQuery();
            $components = OrderItemList::create(OrderItem::class, 'OrderID');
            $components->setDataQuery($query);
            $components = $components->forForeignID($this->ID);
        }
        return $components;
    }
public function getComponents($componentName, $id = null)
    {
        $components = parent::getComponents($componentName, $id);
        if ($componentName === 'Items' && get_class($components) !== UnsavedRelationList::class) {
            $query = $components->dataQuery();
            $components = OrderItemList::create(OrderItem::class, 'OrderID');
            $components->setDataQuery($query);
            $components = $components->forForeignID($this->ID);
        }
        return $components;
    }
public function getComponents ( $ componentName , $ id = null ) { $ components = parent :: getComponents ( $ componentName , $ id ) ; if ( $ componentName === 'Items' && get_class ( $ components ) !== UnsavedRelationList :: class ) { $ query = $ components -> dataQuery ( ) ; $ components = OrderItemList :: create ( OrderItem :: class , 'OrderID' ) ; $ components -> setDataQuery ( $ query ) ; $ components = $ components -> forForeignID ( $ this -> ID ) ; } return $ components ; }
Hack for swapping out relation list with OrderItemList

@inheritdoc
Hack for swapping out relation list with OrderItemList