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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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