Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate Relations are not added to Model files while appearing mysql files in xPDO 3.0.1 #234

Open
wshawn opened this issue Sep 28, 2022 · 1 comment

Comments

@wshawn
Copy link

wshawn commented Sep 28, 2022

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>
@wshawn wshawn changed the title Aggregate Relations are not added to Model files xPDO 3.0.1 Aggregate Relations are not added to Model files while appearing mysql files in xPDO 3.0.1 Oct 1, 2022
@wshawn
Copy link
Author

wshawn commented Oct 1, 2022

This topic isn't closed while #159 I linked to is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant