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

geocodable conflicts with concrete_inheritance #35

Open
miklcct opened this issue Jul 15, 2015 · 0 comments
Open

geocodable conflicts with concrete_inheritance #35

miklcct opened this issue Jul 15, 2015 · 0 comments

Comments

@miklcct
Copy link

miklcct commented Jul 15, 2015

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.

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

No branches or pull requests

1 participant