Created
August 26, 2014 07:28
-
-
Save anonymous/aa3e842c8c58a0f5b221 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<model package="gxTest" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1"> | |
<object class="gxBox" table="gx_box" extends="xPDOSimpleObject"> | |
<field key="title" dbtype="varchar" precision="255" phptype="string" null="false"/> | |
<field key="properties" dbtype="text" phptype="string" null="false"/> | |
<field key="class_alias" dbtype="varchar" precision="255" phptype="string" null="false"/> | |
<composite alias="gxBoxWater" class="gxBoxWater" local="id" foreign="id" cardinality="one" owner="local"/> | |
<composite alias="gxBoxAutomobil" class="gxBoxAutomobil" local="id" foreign="id" cardinality="one" owner="local"/> | |
</object> | |
<object class="gxBoxWater" table="gx_box_water" extends="xPDOSimpleObject"> | |
<field key="pressure" dbtype="int" precision="11" phptype="integer" null="false"/> | |
<field key="speed" dbtype="int" precision="11" phptype="integer" null="false"/> | |
<field key="beasts" dbtype="varchar" precision="255" phptype="string" null="false"/> | |
<aggregate alias="gxBox" class="gxBox" local="id" foreign="id" cardinality="one" owner="foreign"/> | |
</object> | |
<object class="gxBoxAutomobil" table="gx_box_sky" extends="xPDOSimpleObject"> | |
<field key="wheels" dbtype="int" precision="11" phptype="integer" null="false"/> | |
<field key="has_truck" dbtype="tinyint" precision="1" phptype="boolean" null="false"/> | |
<field key="truck_volume" dbtype="int" precision="11" phptype="integer" null="false"/> | |
<aggregate alias="gxBox" class="gxBox" local="id" foreign="id" cardinality="one" owner="foreign"/> | |
</object> | |
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$waterbox = $modx->newObject('gxBox',array( | |
'title' => 'FirstBoxOfWater', | |
'class_alias' => 'gxBoxWater' | |
)); | |
$waterbox->addOne($modx->newObject('gxBoxWater',array( | |
'pressure' => '1.34', | |
)),'gxBoxWater'); | |
$automobil = $modx->newObject('gxBox',array( | |
'title' => 'SecondBoxOfAutomobil', | |
'class_alias' => 'gxBoxAutomobil' | |
)); | |
$automobil->addOne($modx->newObject('gxBoxAutomobil',array( | |
'wheels' => 5/*=D*/ | |
)),'gxBoxWater'); | |
$waterbox->save(); | |
$automobil->save(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment