Storm\Core\Mapping\DomainDatabaseMap::GetEntityRelationalMap PHP Method

GetEntityRelationalMap() final public method

Gets the registered relational map for the given entity type.
final public GetEntityRelationalMap ( string $EntityType ) : Storm\Core\Mapping\IEntityRelationalMap | null
$EntityType string The type of the entity (sub classes will resolve)
return Storm\Core\Mapping\IEntityRelationalMap | null The relational map or null if not found
    public final function GetEntityRelationalMap($EntityType)
    {
        if ($this->HasEntityRelationalMap($EntityType)) {
            return $this->EntityRelationMaps[$EntityType];
        } else {
            $ParentType = get_parent_class($EntityType);
            if ($ParentType === false) {
                return null;
            } else {
                return $this->GetEntityRelationalMap($ParentType);
            }
        }
    }

Usage Example

 protected final function MakeLazyRevivalData(DomainDatabaseMap $DomainDatabaseMap, Relational\ResultRow $ParentData, callable $RevivalDataLoader)
 {
     $RelatedData = $DomainDatabaseMap->GetEntityRelationalMap($this->GetEntityType())->ResultRow();
     $this->ToOneRelation->MapRelationalParentDataToRelatedData($ParentData, $RelatedData);
     $AlreadyKnownRelatedRevivalData = $DomainDatabaseMap->MapResultRowDataToRevivalData($this->GetEntityType(), $RelatedData);
     return new LazyRevivalData($AlreadyKnownRelatedRevivalData, $RevivalDataLoader);
 }