Skip to content
This repository was archived by the owner on Nov 4, 2019. It is now read-only.
This repository was archived by the owner on Nov 4, 2019. It is now read-only.

geocodable conflicts with concrete_inheritance #35

@miklcct

Description

@miklcct

When a table with concrete_inheritance inherits from a table with geocodable, the resulting class cannot be used:

<table name="ContactItem">
    <behavior name="geocodable" />
    <column name="public" type="BOOLEAN" required="true"
            defaultValue="false"/>
    <column name="phone" size="15"/>
    <column name="email" size="254">
        <vendor type="mysql">
            <parameter name="Charset" value="utf8"/>
            <parameter name="Collate" value="utf8_unicode_ci"/>
        </vendor>
    </column>
    <column name="website" size="2048"/>
    <column name="address" type="LONGVARCHAR"/>
    <column name="district_id" type="VARCHAR" size="32"/>
    <foreign-key foreignTable="District" onDelete="restrict"
                 onUpdate="restrict">
        <reference local="district_id" foreign="id"/>
    </foreign-key>
</table>
<table name="Person">
    <behavior name="concrete_inheritance">
        <parameter name="extends" value="ContactItem"/>
    </behavior>
    <column name="first_name" required="true" size="35"/>
    <column name="last_name" required="true" size="35"/>
    <column name="password"/>
    <column name="remember_token"/>
    <column name="gender" type="BOOLEAN"/>
    <column name="birthday" type="DATE"/>
</table>

The getDistanceTo() method generated as a result of inheriting from the base class is not compatible to the base class:

   [ErrorException]                                                                                                                                                                                                               
  Declaration of App\Models\Base\Person::getDistanceTo() should be compatible with App\Models\Base\Contactitem::getDistanceTo(App\Models\Contactitem $contactitem, $unit = App\Models\Map\ContactitemTableMap::KILOMETERS_UNIT)  

The generated method should refer to the base object instead of this object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions