Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TimeToogo/Pinq
PHP Integrated Query, a real LINQ library for PHP
https://github.com/TimeToogo/Pinq
Last synced: about 1 month ago
JSON representation
PHP Integrated Query, a real LINQ library for PHP
- Host: GitHub
- URL: https://github.com/TimeToogo/Pinq
- Owner: TimeToogo
- License: mit
- Archived: true
- Created: 2014-03-29T00:30:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-05-03T14:53:29.000Z (over 2 years ago)
- Last Synced: 2024-10-02T02:42:05.901Z (2 months ago)
- Language: PHP
- Homepage: http://timetoogo.github.io/Pinq/
- Size: 3.73 MB
- Stars: 461
- Watchers: 28
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php - PINQ - A PHP library based on .NET's LINQ (Language Integrated Query). (Table of Contents / Data Structure and Storage)
- awesome-php-cn - PINQ - 一个基于PHP库.NET's LINQ (Language Integrated Query). (目录 / 数据结构和存储 Data Structure and Storage)
- awesome-projects - PINQ - A PHP library based on .NET's LINQ (Language Integrated Query). (PHP / Data Structure and Storage)
- awesome-php - PINQ - A PHP library based on .NET's LINQ (Language Integrated Query). (Table of Contents / Data Structure and Storage)
README
PHP Integrated Query - [Official site](http://timetoogo.github.io/Pinq/)
========================================================================[![Build status](https://img.shields.io/travis/TimeToogo/Pinq/master.svg?style=flat-square)](https://travis-ci.org/TimeToogo/Pinq)
[![Code quality](https://img.shields.io/scrutinizer/g/TimeToogo/Pinq.svg?style=flat-square)](https://scrutinizer-ci.com/g/TimeToogo/Pinq)
[![Coverage Status](https://img.shields.io/coveralls/TimeToogo/Pinq/master.svg?style=flat-square)](https://coveralls.io/r/TimeToogo/Pinq?branch=master)
[![Stable Release](https://img.shields.io/packagist/v/TimeToogo/Pinq.svg?style=flat-square)](https://packagist.org/packages/timetoogo/pinq)
[![License](https://img.shields.io/github/license/TimeToogo/Pinq.svg?style=flat-square)](https://packagist.org/packages/timetoogo/pinq)What is PINQ?
=============Based off the .NET's [LINQ (Language integrated query)](http://msdn.microsoft.com/en-us/library/bb397926.aspx),
PINQ unifies querying across [arrays/iterators](http://timetoogo.github.io/Pinq/examples.html) and [external data sources](http://timetoogo.github.io/Pinq/query-provider.html),
in a single readable and concise [fluent API](http://timetoogo.github.io/Pinq/api.html).An example
==========```php
$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](http://timetoogo.github.io/Pinq/examples.html)
Installation
============PINQ is compatible with >= PHP 7.3
Install the package via composer:
```
composer require timetoogo/pinq
```