vmeretail / multi-tenancy-bundle

A multi tenancy bundle for Symfony 2 apps
25 stars 11 forks source link

[BUG] TenantUser invalid mapping #24

Open pmartelletti opened 9 years ago

pmartelletti commented 9 years ago

From doctrine:schema:validate command:

[Mapping]  FAIL - The entity-class 'Tahoe\Bundle\MultiTenancyBundle\Entity\TenantUser' mapping is invalid:
* The association Tahoe\Bundle\MultiTenancyBundle\Entity\TenantUser#tenant refers to the inverse side field Tahoe\JobcostifyBundle\Entity\Tenant#tenantUsers which does not exist.
* The association Tahoe\Bundle\MultiTenancyBundle\Entity\TenantUser#user refers to the inverse side field Tahoe\JobcostifyBundle\Entity\User#tenantUsers which does not exist.

So, we have a problem here as the bundle does not have an User entity (nor even an abstract one, just the MultiTenantUserInterface), that part of the relation has to be done on the User entity of your app.

So, not sure if:

1 - we need to create a base entity in the tenant user bundle, from which you would extend your user 2- just put this in the documentation (that you need to create the doctrine relationship).

@stevergill , @konradpodgorski : ideas? thoughts?

pmartelletti commented 9 years ago

Same is happening with the tenant relationship :cry:

Altough we have a Tenant class, we cannot put the relationship there because:

 [Doctrine\ORM\Mapping\MappingException]                                                                                                           
  It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass 'Tahoe\Bundle\MultiTenancyBundle\Entity\Tenant  
  #tenantUsers'.