承接 harp-orm/identity-map 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

harp-orm/identity-map

Composer 安装命令:

composer require harp-orm/identity-map

包简介

Allow only identical objects

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

This package allows having "canonical objects".

Usage

Assuming "new Item(1)" will have id of "1":

$map = new IdentityMap(function ($item) {
    return $item->getId();
});

$item1 = new Item(1);
$item2 = new Item(1);
$item3 = new Item(2);

echo $map->get($item1); // Will return item1
echo $map->get($item2); // Will return item1
echo $map->get($item3); // Will return item3

That way you can make sure items with the same key are the same physical objects

The closure argument that use pass to the identity map, needs to return the "unique key" for each product.

License

Copyright (c) 2014-2015, Clippings Ltd. Developed by Ivan Kerin as part of Clippings.com

Under BSD-3-Clause license, read LICENSE file.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-09-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固