2017 © Pedro Peláez
 

library doctrine-dto

image

konstantin-kuklin/doctrine-dto

  • Sunday, July 12, 2015
  • by KonstantinKuklin
  • Repository
  • 1 Watchers
  • 15 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 67 % Grown

The README.md

DoctrineDto

Build Status Scrutinizer Code Quality Code Coverage GitHub release Total Downloads Daily Downloads Minimum PHP Version License, (*1)

What is DoctrineDto?

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)

Requirements

Single dependency: Doctrine orm library Also you need to have PHP >= 5.3, (*3)

Installation

The simplest way to add DoctrineDto is execute command:, (*4)

composer require "konstantin-kuklin/doctrine-dto" "dev-master"

Usage example

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');

Usage with Symfony

For using with Symfony framework go to DoctrineDtoBundle., (*7)

The Versions

12/07 2015

dev-master

9999999-dev https://github.com/KonstantinKuklin/DoctrineDto

  Sources   Download

MIT

The Development Requires

by Konstantin Kuklin

php library doctrine dto