xpdo
xpdo copied to clipboard
Aggregate Relations are not added to Model files while appearing mysql files in xPDO 3.0.1
Previously seen in #159.
This is occurring in xPDO X3.0.1's XPDO as well. No aggregates get added to the model files across the entire schema, while being correctly added to the database engine files:
Also. comments are no longer added either, which was really nice to be able to document all the class files from the schema.
The primary key (integer id) is not added to the model files either and have to added manually for documentation.
Sanityllc\Devotional\Model;
/**
* Class Patron
*
* @property string $displayName
* @property string $addedOn
* @property string $bibleAbbr
* @property integer $languageId
* @property integer $siteUserId
*
* @property \Sanityllc\Devotional\Model\PatronActivity[] $Activities < COMPOSITE ONLY
*
* @package Sanityllc\Devotional\Model
*/
class Patron extends \xPDO\Om\xPDOSimpleObject
{
}
Sanityllc\Devotional\Model\mysql;
class Patron extends \Sanityllc\Devotional\Model\Patron
{
public static $metaMap = array (
'package' => 'Sanityllc\\Devotional\\Model',
'version' => '3.0',
'table' => 'patron',
'extends' => 'xPDO\\Om\\xPDOSimpleObject',
'tableMeta' =>
array (
'engine' => 'InnoDB',
),
'fields' =>
array (
'displayName' => NULL,
'addedOn' => 'CURRENT_TIMESTAMP',
'bibleAbbr' => NULL,
'languageId' => 0,
'siteUserId' => 0,
),
'fieldMeta' =>
array (
'displayName' =>
array (
'dbtype' => 'varchar',
'precision' => '50',
'phptype' => 'string',
'null' => true,
),
'addedOn' =>
array (
'dbtype' => 'datetime',
'phptype' => 'datetime',
'default' => 'CURRENT_TIMESTAMP',
),
'bibleAbbr' =>
array (
'dbtype' => 'varchar',
'precision' => '12',
'phptype' => 'string',
'null' => false,
'index' => 'fk',
),
'languageId' =>
array (
'dbtype' => 'int',
'precision' => '10',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'default' => 0,
'index' => 'fk',
),
'siteUserId' =>
array (
'dbtype' => 'int',
'precision' => '10',
'attributes' => 'unsigned',
'phptype' => 'integer',
'null' => false,
'default' => 0,
'index' => 'fk',
),
),
'composites' =>
array (
'Activities' =>
array (
'class' => 'Sanityllc\\Devotional\\Model\\PatronActivity',
'local' => 'id',
'foreign' => 'patronId',
'owner' => 'local',
'cardinality' => 'many',
),
),
'aggregates' => <-- Aggregates parsed
array (
'Language' =>
array (
'class' => 'Sanityllc\\Devotional\\Model\\Language',
'local' => 'languageId',
'foreign' => 'id',
'owner' => 'foreign',
'cardinality' => 'one',
),
'Source' =>
array (
'class' => 'Sanityllc\\Devotional\\Model\\Bible',
'local' => 'bibleAbbr',
'foreign' => 'abbr',
'owner' => 'foreign',
'cardinality' => 'one',
),
),
);
}
Schema
<object class="Patron" table="patron" extends="xPDO\Om\xPDOSimpleObject">
<field key="displayName" dbtype="varchar" precision="50" phptype="string" null="true" />
<field key="addedOn" dbtype="datetime" phptype="datetime" default="CURRENT_TIMESTAMP" />
<field key="bibleAbbr" dbtype="varchar" precision="12" phptype="string" null="false" index="fk"/>
<field key="languageId" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="fk" />
<field key="siteUserId" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="fk" />
<aggregate alias="Language" class="Sanityllc\Devotional\Model\Language" local="languageId" foreign="id" owner="foreign" cardinality="one" />
<aggregate alias="Source" class="Sanityllc\Devotional\Model\Bible" local="bibleAbbr" foreign="abbr" owner="foreign" cardinality="one" />
<composite alias="Activities" class="Sanityllc\Devotional\Model\PatronActivity" local="id" foreign="patronId" owner="local" cardinality="many" />
</object>
This topic isn't closed while #159 I linked to is.