PINQ

PHP集成查询,PHP的一个真正的LINQ库。(PHP Integrated Query, a real LINQ library for PHP.)

  • 所有者: TimeToogo/Pinq
  • 平台: Linux, Mac, Windows
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

PHP Integrated Query

PINQ 是什么?

基于 .NET 的 LINQ(语言集成查询),PINQ 将跨数组/迭代器和外部数据源的查询统一为一个可读且简洁流畅的 API。

一个例子

以下显示使用 PINQ 库的示例查询:

$youngPeopleDetails = $people
        ->where(function ($row) { return $row['age'] <= 50; })
        ->orderByAscending(function ($row) { return $row['firstName']; })
        ->thenByAscending(function ($row) { return $row['lastName']; })
        ->take(50)
        ->indexBy(function ($row) { return $row['phoneNumber']; })
        ->select(function ($row) { 
            return [
                'fullName'    => $row['firstName'] . ' ' . $row['lastName'],
                'address'     => $row['address'],
                'dateOfBirth' => $row['dateOfBirth'],
            ]; 
        });

PINQ 的优点如下,上述查询可能针对一组数组或可能针对数据库表执行。 PINQ 使用 PHP 开发人员可用的最强大和最自然的语言来模糊内存和外部数据源之间的界限。

更多例子

安装

PINQ 兼容 >= PHP 5.5

通过composer安装包:

composer require timetoogo/pinq

主要指标

概览
名称与所有者TimeToogo/Pinq
主编程语言PHP
编程语言PHP (语言数: 1)
平台Linux, Mac, Windows
许可证MIT License
所有者活动
创建于2014-03-29 00:30:11
推送于2022-05-03 14:53:29
最后一次提交2022-05-04 00:53:28
发布数15
最新版本名称3.5.0 (发布于 )
第一版名称1.0.0 (发布于 )
用户参与
星数461
关注者数27
派生数19
提交数476
已启用问题?
问题数20
打开的问题数2
拉请求数6
打开的拉请求数1
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

PHP Integrated Query - Official site

Build status
Code quality
Coverage Status
Stable Release
License

What is PINQ?

Based off the .NET's LINQ (Language integrated query),
PINQ unifies querying across arrays/iterators and external data sources,
in a single readable and concise fluent API.

An example

$youngPeopleDetails = $people
        ->where(function ($row) { return $row['age'] <= 50; })
        ->orderByAscending(function ($row) { return $row['firstName']; })
        ->thenByAscending(function ($row) { return $row['lastName']; })
        ->take(50)
        ->indexBy(function ($row) { return $row['phoneNumber']; })
        ->select(function ($row) { 
            return [
                'fullName'    => $row['firstName'] . ' ' . $row['lastName'],
                'address'     => $row['address'],
                'dateOfBirth' => $row['dateOfBirth'],
            ]; 
        });

More examples

Installation

PINQ is compatible with >= PHP 5.5

Install the package via composer:

composer require timetoogo/pinq