Need help with Pinq?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

TimeToogo
450 Stars 15 Forks MIT License 472 Commits 3 Opened issues

Description

PHP Integrated Query, a real LINQ library for PHP

Services available

!
?

Need anything else?

Contributors list

# 179,210
PHP
Shell
C
termina...
52 commits
# 343,620
Shell
PHP
Lua
1 commit

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 7.3

Install the package via composer:

composer require timetoogo/pinq

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.