承接 ialopezg/collections 相关项目开发

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

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

ialopezg/collections

Composer 安装命令:

composer require ialopezg/collections

包简介

PHP Base Library for Collection Management

README 文档

README

PHP based Collections Manager

Installation

composer require ialopezg/collections

Requirements

  • PHP 5.6+

Features

  • Set item
  • Update item
  • Remove item
  • Lookup for an item
    • By key name when single lookup
    • By dot notation when nested lookup
  • Data cache for quick access
  • Access to firs level object by invoking its name in the class, by example: echo $collection->itemName;. Protected properties cannot be invoked.
  • Merging of classes are derivative from CollectionInterface.
  • Access to its items like associative arrays.

Usage

use ialopezg\Libraries\Collection;

// class derived from Collection class
class ItemCollection extends Collection { }

$collection = new ItemCollection([]);
// get the value, if not found return default value
echo $collection->get('item_name', 'initial value');
// changing item_name's value
$collection->set('item_name', 'item value');
// print current value
if ($collection->has('item_name')) {
    echo $collection->get('item_name');
}
// remove item_name property
$collection->remove('item_name');

echo $collection->count();

Please, check examples directory for more details of usage or run:

### from linux bash
./server.sh

or

### from windows bash
server.bat

License

This project is under the MIT license. For more information see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固