yellowcable/collection 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

yellowcable/collection

最新稳定版本:2.0.0

Composer 安装命令:

composer require yellowcable/collection

包简介

Collection and Aggregation.

README 文档

README

Collection and Aggregation library for PHP8.2+

Create object collections and be in control of iteration and access.

  • You can either extend the abstract or implement and use the interfaces and traits.
  • Aggregation is simple; it clears the content of the collections!

Usage

To use a Collection, make sure you create or instantiate:

$collection = new ItemCollection("test", [
    new Item("1", 1, 1),
    new Item("1", 1, 1),
    new Item("1", 1, 1),
    new Item("1", 1, 1),
]);
-----------------------------------------------
$collection = new class () extends Collection
{
    public function getClass(): string
    {
        return Item::class;
    }
};

Aggregations are possible in the same fashion as Collections:

$agg = new ItemAggregation("bliep");
$agg->addCollection(new ItemCollection("test", [new Item("item", 1, 1)]), false);

Notes

  • Don't use stdClass if you want to serialize; PHP will not allow it.

Contribute

Contributions are always welcome! Suggestions are only welcome in the form of code.

License

CC0

To the extent possible under law, Yellow Cable has waived all copyright and related or neighboring rights to this work.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: CC0-1.0
  • 更新时间: 2023-07-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固