public function toDataTransferObject(string $root, array $schema, array $transformations, $path='')
    {
        $entities = new DatamapperCollection;

        foreach ($this->items as $name => $item) {
            $entities->put($name, $item->toDataTransferObject($root, $schema, $transformations, $path));
        }

        return $entities;
    }
public function toDataTransferObject(string $root, array $schema, array $transformations, $path='')
    {
        $entities = new DatamapperCollection;

        foreach ($this->items as $name => $item) {
            $entities->put($name, $item->toDataTransferObject($root, $schema, $transformations, $path));
        }

        return $entities;
    }
public function toDataTransferObject ( string $ root , array $ schema , array $ transformations , $ path = '' ) { $ entities = new DatamapperCollection ; foreach ( $ this -> items as $ name => $ item ) { $ entities -> put ( $ name , $ item -> toDataTransferObject ( $ root , $ schema , $ transformations , $ path ) ) ; } return $ entities ; }
Convert models to data transfer objects.

@param string $root
@param array $schema
@param array $transformations
@param string $path
@return \ProAI\Datamapper\Support\Collection
Convert models to data transfer objects .