safrazik / breeze.server.php

Breeze JS support for PHP applications
MIT License
29 stars 11 forks source link

Child entity types define the inherited navigation properties again #4

Closed safrazik closed 10 years ago

safrazik commented 10 years ago

e.g:


namespace Test\Model;

class Address {
}

class Person {
  protected $firstName; // string
  protected $address; // instance of Address
}

class Employee extends Person {
}

the metadata generated is

{
  "structuralTypes": [
    {
      "shortName": "Person",
      "namespace": "Test.Model",
      "dataProperties": [
        {
          "name": "firstName",
          "dataType": "String"
        }
      ],
      "navigationProperties": [
        {
          "name": "address",
          "entityTypeName": "Address:#Test.Model",
          "isScalar": true
        }
      ]
    },
    {
      "shortName": "Employee",
      "baseTypeName": "Person:#Test.Model",
      "namespace": "Test.Model",
      "dataProperties": [ ],
      "navigationProperties": [
        {
          "name": "address",
          "entityTypeName": "Address:#Test.Model",
          "isScalar": true
        }
      ]
    }
  ]
}

while navigation property address is inherited from Person entity, Employee entity should not define it again. This is already working with dataProperties