public function asEntity()
    {
        call_user_func($this->callback, $this->propertyName, function (EntityRelation $relation) {
            /** @var IEntityMapper $entityMapper */
            $entityMapper = $relation->getMapper();
            if ($relation instanceof IToOneRelation) {
                return new ToOneRelationObjectReference($entityMapper);
            } else {
                return new ToManyRelationObjectReference($entityMapper);
            }
        });
    }
public function asEntity()
    {
        call_user_func($this->callback, $this->propertyName, function (EntityRelation $relation) {
            /** @var IEntityMapper $entityMapper */
            $entityMapper = $relation->getMapper();
            if ($relation instanceof IToOneRelation) {
                return new ToOneRelationObjectReference($entityMapper);
            } else {
                return new ToManyRelationObjectReference($entityMapper);
            }
        });
    }
public function asEntity ( ) { call_user_func ( $ this -> callback , $ this -> propertyName , function ( EntityRelation $ relation ) { /** @var IEntityMapper $entityMapper */ $ entityMapper = $ relation -> getMapper ( ) ; if ( $ relation instanceof IToOneRelation ) { return new ToOneRelationObjectReference ( $ entityMapper ) ; } else { return new ToManyRelationObjectReference ( $ entityMapper ) ; } } ) ; }
Defines to load the relation as the hydrated entity object.

If it is a to-many relation a collection of entities will be loaded.

@return void
Defines to load the relation as the hydrated entity object .