/** * Adds an entity relational map instance to this domain database map. * * @param IEntityRelationalMap $EntityRelationalMap The entity relational mapping class. * @throws MappingException If the entity is not part of the given domain */ private function AddEntityRelationMap(IEntityRelationalMap $EntityRelationalMap) { $EntityRelationalMap->Initialize($this); $EntityType = $EntityRelationalMap->GetEntityType(); if (!$this->Domain->HasEntityMap($EntityType)) { throw new MappingException('The supplied entity relational map for %s is not part of the given domain.', $EntityType); } $this->EntityRelationMaps[$EntityType] = $EntityRelationalMap; $this->EntityRelationMapsByPrimaryKeyTable[$EntityRelationalMap->GetPrimaryKeyTable()->GetName()] = $EntityRelationalMap; }