定制 dannyb/phydrator 二次开发

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

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

dannyb/phydrator

Composer 安装命令:

composer require dannyb/phydrator

包简介

PHP entity hydration

README 文档

README

A simple utility library for entity hydration in PHP.

Defining a Hydrator

All that should be necessary is to have an entity class (using PHP7.4+ property types), and then a very simple class such as this:

namespace PHydrator\Hydrator;

use PHydrator\AbstractHydrator;

class MyHydrator extends AbstractHydrator
{
    protected const ENTITY_CLASS = MyEntity::class;
}

Autoloading Hydrators

The recommended method of registering hydrators is to specify a namespace in the config when initialising PHydrator:

use PHydrator\Config;
use PHydrator\PHydrator;
// ...
$config = new Config();
$config->autoloadNamespace = "App\\Hydrators";
$pHydrator = new PHydrator($config);
// ...

If an autoload namespace isn't specified, you will need to manually register your hydrators.

Note that this is also an option if you have hydrators in other namespaces.

use PHydrator\PHydrator;
// ...
$pHydrator = new PHydrator();
$pHydrator->registerHydrator(MyHydrator::class);
// ...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固