public static function newFromDatamapperObject($entities, $lastObjectId, $lastEloquentModel)
    {
        $eloquentModels = new static;

        foreach ($entities as $name => $item) {
            if (spl_object_hash($item) == $lastObjectId) {
                $model = $lastEloquentModel;
            } else {
                $model = Model::newFromDatamapperObject($item, $lastObjectId, $lastEloquentModel);
            }

            $eloquentModels->put($name, $model);
        }

        return $eloquentModels;
    }
public static function newFromDatamapperObject($entities, $lastObjectId, $lastEloquentModel)
    {
        $eloquentModels = new static;

        foreach ($entities as $name => $item) {
            if (spl_object_hash($item) == $lastObjectId) {
                $model = $lastEloquentModel;
            } else {
                $model = Model::newFromDatamapperObject($item, $lastObjectId, $lastEloquentModel);
            }

            $eloquentModels->put($name, $model);
        }

        return $eloquentModels;
    }
public static function newFromDatamapperObject ( $ entities , $ lastObjectId , $ lastEloquentModel ) { $ eloquentModels = new static ; foreach ( $ entities as $ name => $ item ) { if ( spl_object_hash ( $ item ) == $ lastObjectId ) { $ model = $ lastEloquentModel ; } else { $ model = Model :: newFromDatamapperObject ( $ item , $ lastObjectId , $ lastEloquentModel ) ; } $ eloquentModels -> put ( $ name , $ model ) ; } return $ eloquentModels ; }
Convert models to eloquent models.

@param \ProAI\Datamapper\Support\Collection $entities
@param string $lastObjectId
@param \ProAI\Datamapper\Eloquent\Model $lastEloquentModel
@return \ProAI\Datamapper\Eloquent\Collection
Convert models to eloquent models .