<?php

class FakeController extends oxUBase
{

    public function render()
    {
        $oParent = oxNew('oxarticle');
        $oParent->setId('fakeparent');
        $oParent->oxarticles__oxtitle = new oxField('Fake Parent');
        $oParent->oxarticles__oxactive = new oxField(0);
        $oParent->save();

        $oChild = oxNew('oxarticle');
        $oChild->setId('fakechild');
        $oChild->oxarticles__oxparentid = new oxField('fakeparent');
        $oPrice = new oxPrice(20);
        $oChild->setPrice($oPrice);
        $oChild->oxarticles__oxstock = new oxField(0);
        $oChild->oxarticles__oxactive = new oxField(0);
        $oChild->oxarticles__oxstock = new oxField(25);
        $oChild->save();

        $oChild->oxarticles__oxactive = new oxField(1);
        $oChild->save();

        $oParent->oxarticles__oxactive = new oxField(1);
        $oParent->save();

    }
}