dev-master
9999999-dev https://github.com/KonstantinKuklin/DoctrineDto
MIT
The Development Requires
- php >=5.3
- doctrine/orm 2.2.*
by Konstantin Kuklin
php library doctrine dto
Wallogit.com
2017 © Pedro Peláez
Library for getting Data Transfer Object from a database through Doctrine. If you are using a service approach to development, this library can be useful for you., (*2)
Single dependency: Doctrine orm library Also you need to have PHP >= 5.3, (*3)
The simplest way to add DoctrineDto is execute command:, (*4)
composer require "konstantin-kuklin/doctrine-dto" "dev-master"
Initialize Dto -> Entity class map:, (*5)
// static map rules here:
$map = new Map(
array(
'Path\To\UserEntity' => 'Path\To\UserDto',
'Path\To\AnotherEntity' => 'Path\To\AnotherDto'
)
);
// class to dynamic class map generation
$map->addMapGeneratorElement(new EntityDtoSimpleGenerator());
// set class map
DtoClassMap::setMap($map, $map->getFlippedMap());
Add custom hydrator in your code with such example:, (*6)
$em->getConfiguration()->addCustomHydrationMode('DtoHydrator', 'KonstantinKuklin\DoctrineDto\Hydrator\DtoHydrator');
$query = $em->createQuery('SELECT u FROM CmsUser u');
$results = $query->getResult('DtoHydrator');
For using with Symfony framework go to DoctrineDtoBundle., (*7)
MIT
php library doctrine dto