定制 konstantin-kuklin/doctrine-dto 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

konstantin-kuklin/doctrine-dto

Composer 安装命令:

composer require konstantin-kuklin/doctrine-dto

包简介

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage GitHub release Total Downloads Daily Downloads Minimum PHP Version License

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.

Requirements

Single dependency: Doctrine orm library Also you need to have PHP >= 5.3

Installation

The simplest way to add DoctrineDto is execute command:

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

Usage example

Initialize Dto -> Entity class map:

// 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:

$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.

统计信息

  • 总下载量: 139
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固