Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Repository files navigation

PHP Integrated Query - Official site

Build statusCode qualityCoverage StatusStable ReleaseLicense

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 7.3

Install the package via composer:

composer require timetoogo/pinq

About

PHP Integrated Query, a real LINQ library for PHP

Resources

Stars

462 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages